Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Voxera115858yDid this for our templating solution.
At the time all I could find was either to slow, to simple or lacked a proven sandbox.
And since customers have access a sandbox was a requirement.
We'r on version 5 of the language right now and last one added lambda support and simple reflection.
Next one might start to use IL emit to speed up instead of interpreter but not sure yet. Can do about 300 full page renders per sec on single thread and it is still enough. -
monnef3158y@heyheni It's a stack and "physics-based" language. A falling ball (viewed from side) is executing instructions when it touches them. I might have designed it a bit too complex - on paper it has even an equivalent of subroutines 😀.
-
Nice! :D
And this falling ball, is it interactive? Can you klick it and do code execution scratching like a turntable? -
Voxera115858yFirst get a clear picture of what it should achieve.
Then look on similar languages for ideas of syntax.
Making a very simple language for scripting is not to hard but making one more complete very quickly grows in complexity.
A simple line by line statement language is almost trivial.
Adding conditionals is a little more complex since you need both containment and condition logic.
Looping is one more step up the ladder.
I have probably read a couple of thousand pages on the subject during the eight years I have been building on my lang. -
@Voxera
Can u suggest me some material or documentation that I can refer to begin -
monnef3158y@heyheni Programmer can use "bouncers" sensitive to a top of the stack (basically if statement) and for looping there are portals. Well, none of it is working yet (only parsing), but I hope I will finish it soon ☺️. It is great fun to explore new language (Haskell) and at a same time to learn something more about programming languages in general (last time I was dealing with similar stuff was at university).
-
monnef3158y@ajay-1997 Not a documentation (closest thing would probably be some university course), but if you are looking for inspiration you can check out this wiki - https://esolangs.org/wiki/....
-
Voxera115858yFor parsing either look at some existing that supports ebn grammar
Or look an recursive decent parser.
Also look into abstract syntax tree, that is a sort of tree like representation if a program.
My interpreter is walking the ast directly but also does some optimisations on it.
Her are a few links to start of with but be sure to search for more. Especially tutorials.
Might start with the last one ;)
https://en.m.wikipedia.org/wiki/...
http://stackoverflow.com/questions/...
https://codeproject.com/Articles/...
https://google.se/amp/...
http://nathansuniversity.com
And the especially
http://nathansuniversity.com/scheem...
The last one is an interactive tutorial where you actually are building the interpreter right in the web page
Related Rants
-
snackOverflow8One day a client sent me gifts and a sweet letter just because they loved their new website so much. I just ab...
-
djsumdog2This is what happens when you lie about your sheep herding experience on your Resume/CV.
-
dibbler6722Not a specifically dev related story, but absolutely rant worthy. Today I was working from home, and my wife ...
Bonus points if you also wrote it in a language entirely new to you, or even in entirely different paradigm. (In my case Haskell.)
undefined
aww
haskell
interpreter