Theodore H. Smith
2013-Mar-21 13:06 UTC
[LLVMdev] Universal tool for creating your own language and parsing the AST
Hi everyone, I'm writing a language, that will be a "generic language", useful for (I hope) describing any language. It's called Jeebox. I've had success describing C, ObjC, PHP, JavaScript, Java, my own language SpeedyCog, and others. It isn't released YET... but I am working on it. What is the relevance to LLVM? Well... once Jeebox is released... it will remove one big part of actually making a programming language, the designing of your syntax, and the parsing of syntax. I don't have a time-line to completion, but I do have a announcement mailing list. In terms of the code, I am 90% of the way however. Perhaps 2 months at maximum to a usable beta. You can think of Jeebox like "The Unicode of programming languages", much like Unicode can describe every characterset, Jeebox can describe every programming language. Heres a simple example: // Python friends = ['john', 'pat', 'gary', 'michael'] for i, name in enumerate(friends): print "iteration {iteration} is {name}".format(iteration=i, name=name) // Jeebox friends = ['john', 'pat', 'gary', 'michael'] for (i : name in enumerate(friends)) { print "iteration {i} is {name}" } So we are describing the same concept, with slightly different syntax, but the meaning is the same. This way, you get a nice simple AST, without doing much work except calling "AST = Parse(SomeString)" ... LLVM integration? I'll probably need feedback from users who want to use it for a language of their own, to help create an API or make it easy to integrate Jeebox with their own code. I'd be happy to add things to Jeebox's API, to make it useful specifically for LLVM. (it will be primarily a C api, but with bindings for other languages too). Again... there's nothing practically useful yet, we have an AST parser demo but it's in GUI-only form. Perhaps 2 months at maximum to a usable beta. -- http://jeebox.org/ "An extensible language for describing code, concepts and stories"