Introducing the world's first DreamBerd interpreter #586
Replies: 8 comments 15 replies
-
I simply interpret DreamBerd with my mind. |
Beta Was this translation helpful? Give feedback.
-
Thank you so much for this announcement! Although, I will say, a lot of the features that have thrown errors or not worked have been fixed/patched/added since the interpreter’s initial public release :) |
Beta Was this translation helpful? Give feedback.
-
Doesn't run for me, but that's really cool! So much potential for things to do with this! |
Beta Was this translation helpful? Give feedback.
-
I think you gave me too much credit for the Regular Expressions parsing, my interpreter just removes them entirely before interpreting the code 😂. The |
Beta Was this translation helpful? Give feedback.
-
Holy crap @vivaansinghvi07 you've done the impossible. Incredible job! |
Beta Was this translation helpful? Give feedback.
-
This is seriously impressive! Awesome job Vivaan! |
Beta Was this translation helpful? Give feedback.
-
I'm gonna make the first dreamberd game |
Beta Was this translation helpful? Give feedback.
-
That's crazy |
Beta Was this translation helpful? Give feedback.
-
Over the years, many people have tried and failed to implement DreamBerd. No one has been able to do it...
Until today!
Introducing Vivaan Singhvi, a highschool student who has now created the world's first mostly-functional Dreamberd interpreter. This is extremely impressive, as it's a task that many experienced programmers have struggled with.
As promised, I have now donated £99 to a charity of Vivaan's choice, Second Harvest Food Bank.
The money will pay for approximately 375 meals for children and families experiencing hunger. I now invite you to donate as well! If you do so, please let me know on social media by tagging @TodePond. I'll give you a boost!
Implementation report
Exclamation marks
All exclamation mark syntax worked well.
Notably, the debug information I got from my question mark was clear and helpful.
Console:
Const const
Const var
The
pop
method from the example didn't work, but constant variables worked as expected with other methods.Var const
Var var
Similar to above, the
pop
method didn't work, butpush
worked fine.Const const const
For the first bounty, a global "const 3" server is not needed, so I didn't test this.
However, the interpreter does state that it supports const 3!
Unicode naming
The
1️⃣
emoji didn't work, but most other emojis do work.Notably, the
True
value was correctly interpreted as a string!Number naming
I had to add in some extra whitespace because the interpreter partially implements the parentheses features of DreamBerd, which are not required or tested as part of this first bounty.
Negative one index arrays
Float array indexing
This should print
[3, 2, 4, 5]
instead.When
This was one of the first features I tried. Amazing!
Line-based lifetimes
Time-based lifetimes
This caused an error.
Infinity-based lifetimes
I genuinely can't believe this worked. I ran one program that set an infinite-lifetime constant...
Then I ran another program to read it and print it out.
Loops
There are no loops.
Booleans
The interpreter is based off a slightly older version of DreamBerd that uses the
after
keyword instead ofaddEventListener
. I didn't test those older features, but I tested that you can use themaybe
boolean value still. The interpreter seems to treatmaybe
like a string, which is fine I guess.Significant whitespace
Amazing. Love it.
Powers
Number names
Incredible.
Indentation
The interpreter allows indents of multiples of 3, which is standard practice among DreamBerd implementations. However, it also allows the use of the tabs (in place of two spaces), which is strictly forbidden. I will allow it this once.
Negative indent:
Loose check
Precise check
Identity check
Lexical check
The interpreter should return true for lexical checks when using four equals signs.
Imprecise check
Functions
Dividing by zero
String literals
Zero-quote strings are not required for this bounty, but the interpreter still supports it in some cases. ie: It works for one-word zero-quote strings.
String interpolation
String interpolation worked, though it incorrectly thought I was in america.
Types
Types get stripped and ignored.
Regular expression types
Many regular expressions work, but the long crazy one in the example causes an error.
Previous
It didn't work with the
++
operator, but it worked when I wrote it out like this.Next
I couldn't figure out how to test this one, because I noticed that the DreamBerd example in the docs used old features that aren't supported anymore.
Current
File structure
File names
Exporting
Single instance classes
Factory classes
Time
This caused an error.
Delete numbers
Ridiculous, amazing.
Delete class
Delete delete
Order overloading
Exclamation mark overloading
This worked for the simple case.
But it didn't work for a more complex example.
Inverted exclamation mark
Reversing
Oh my god it works!!!!!!!!
Class names
DBX
Not required as part of this bounty.
Semantic naming
This doesn't require any implementation. Semantic naming melts away as intended.
Asynchronous functions
Really pleased to see this one work!
Noop
As mentioned earlier, zero-quoted strings work, like
noop
.Signals
Destructuring signals
This causes an error.
AI
Another day.
Parentheses
Arbitrary parentheses were not part of this bounty, but the interpreter does a great job at them anyway, which is incredible! Significant whitespace is used to indicate grouping of arguments and operations.
The interpreter errors with more advanced cases, which is understandable.
Comments
Comments aren't explicitly listed in the docs, but they appear in many examples. The following example errors.
// Comment
However, you can comments as strings if you want.
Conclusion
This is a remarkable effort by Vivaan, and it puts DreamBerd into a mostly-usable state. I was more than happy to pay the bounty to Second Harvest Food Bank, and I hope you consider joining me.
In the coming weeks, I'll introduce some more charity bounties, so keep an eye out.
Many thanks,
Lots of love,
Yours sincerely,
Lu (or Luke) (either's fine)
xxxxxxxx
This discussion was created from the release Introducing the world's first DreamBerd interpreter.
Beta Was this translation helpful? Give feedback.
All reactions