03 Jul 2016, 00:20

“A Core Language with Extensible Language Libraries”

Click to view on seperate page…

/u/jaxrtech

True, the proposal is very abstract. To be a bit more concrete, here’s what trying to create a hypothetical implementation might look like running down pipeline from the diagram:

  • Clients: Just about any IDE or editor has an API for code completion, rename refactoring, etc. Given your favorite editor, we would just need >to write a shim for to talk over platform’s protocol to interface the API.

  • Protocol: There are tons of libraries already for writing protocols (e.g. ProtoBufs, msgpack, zmq). Messages can be sent over IPC or plain >old TCP sockets. You would just have to design an API.

  • Compilation Server: This could be a typical CLI program which controls the compilation process. Maybe you would run something like:

    proton compile main.foo --lang jaxrtech/foolang
    

    It could then read a language.json I wrote to determine which libraries my Foolang depends on and start each of them up as a service to start >compiling.

  • Syntax Library: This can be written in anything you want (it could be Java, node.js, it doesn’t matter) as long as it talks over the >protocol, can properly parse text into a syntax tree (and can do the reverse as well), and can translate everything into the core language.

  • Semantic Libraries: Has more or less the same as building a syntax library except you’re just only translating between different grammars. >Any language can do this.

  • Core Language Service: The core language can be abstraction layer on top of LLVM, could compile to JS or C, the JVM or the CLR.