Please help me decide.
Please help me decide.
[1] https://en.wikipedia.org/wiki/OMeta
Thanks for posting.
Thus, I vote Python: it has this amazing parser library, it's garbage-collected (no need to fiddle with memory allocations, like in C), it's dynamically typed (so you basically don't need to think about types at all), it now has a `match` statement (!) that makes it super easy to dissect your parse trees and abstract syntax trees.
Boost.Spirit https://www.boost.org/library/latest/spirit/ Boost.Parser https://www.boost.org/library/latest/parser/ (which I think succeeds Boost.Spirit Boost.Metaparse: https://www.boost.org/doc/libs/latest/doc/html/metaparse.htm...
All of these allow you to build a parser using C++ syntax and then add semantic or composed actions.
I then used python match syntax to convert my ast to C.
So then you could say it was programmed in english*
*Or whatever human language you want.
If you're doing an interpreted language, things get a lot looser. If you've done any programming in the past, it's likely the language you're most familiar with will work ok.
I'd recommend selecting a language you already know well, a language you also want to learn, or a language with libraries (or good bindings to libraries) that you want to take advantage of. If you want to make a compiler but don't want to do code generation (to machine code) yourself you may want to use a language with good LLVM bindings to get support for a lot of target platforms. If you're interested in making an interpreter, you may want to consider the libraries available to the host language. An interpreter implemented in Python gives you a chance to use Python libraries in your new language (same argument for other languages, the decision would be based on what libraries you might want to use).
Also I found it useful to compare other people's implementations to get a feel for different approaches. See this suggestion: https://news.ycombinator.com/item?id=28479120
- Lisp S-expressions are powerful because they represent both code and data. So data is code; code is data: it is very simple to augment the language.
- Lisp S-expression syntax conveniently mirrors the tree shape of Abstract Syntax Trees.
F# also supports macros and meta-programming: futures (F# version of async/await) were added to existing versions of F#. No need for a new language runtime!
If JS had that level of meta-programming, I wouldn't have to wait for pattern-matching support! And pipes!
A smart contract language (for Blockchains)
- Rust
A desktop executable with browser support
- Nim
A cross platform language (iOS, Android, Linix, Mac, Windows)
- Dart
Talk to GPUs
- C++ or C on top of Tensorflow
A toy language for learning compilers/interpreters
- Python
thesuperbigfrog•6mo ago
After you know what you want to build, you could convert it to C, C++, or Rust to make it fast.
Forgret•6mo ago