(The (parentheses (update))) #413
Replies: 10 comments 30 replies
-
Here's my compiler (written in Rust, compiles to Rust): fn main() {
println!("fn main() {}");
} It assumes everything is a zero-quoted-string, unless you specify otherwise1. Input is taken via a file name as a command line argument. Footnotes
|
Beta Was this translation helpful? Give feedback.
-
This is so revolutionary. I bet it takes at least Java 34 to adapt it. |
Beta Was this translation helpful? Give feedback.
-
Given this update, how would the following code run? const const (2 = "String"!
const const ((2 = "String 2"!
print((2)! I'm curious to see an explanation of how a parser would determine this. Would the opening parentheses in the variable names be ignored, too? Also, what about this? const const (2 = "String"!
print()2)! Finally, if "[parentheses] get replaced with whitespace" could this code work? const const ( 2 = "String"! // variable name is "( 2"
print((2)! // Prints "String" ? (and yes this is making it very difficult to write my parser :(((( ) |
Beta Was this translation helpful? Give feedback.
-
Additionally if I use parentheses with an unquoted string: print(bagel77)! Wouldn't there be whitespace before and after the parentheses (in the actual value of the unquoted string), assuming that parentheses are actually replaced with whitespace? |
Beta Was this translation helpful? Give feedback.
-
So are these the same?
|
Beta Was this translation helpful? Give feedback.
-
If I have: a(1, b(2, 3), 4)! and we remove parentheses: a 1, b 2, 3 , 4 ! Is the parser expected to know how many arguments are required for |
Beta Was this translation helpful? Give feedback.
-
I added a testing package for DreamBerd, please have a look at it! |
Beta Was this translation helpful? Give feedback.
-
Does this mean we can't have unquoted strings with exclamation marks anymore? |
Beta Was this translation helpful? Give feedback.
-
Not sure I agree with this, whitespace is so outdated. We could just use parentheses instead |
Beta Was this translation helpful? Give feedback.
-
A few more questions about this Does function hoisting exist here like JavaScript? // a function call like `var(var(a(=(1))))!`
var var a = 1!
function var arg => {}
function a arg => {}
function = arg => {} What happens if the function function var arg => {}
// could be `var(var("a = 1"))!`
var var a = 1! Also what happens if the function named // no arguments
function var => {}
function a => {}
function = => {}
// variable, or a function call like `var(var(a(=(1))))!`
var var a = 1! |
Beta Was this translation helpful? Give feedback.
-
Today we are pleased to announce DreamBerd 3.
With it, we introduce a brand new feature...
Parentheses
Parentheses in DreamBerd do nothing. They get replaced with whitespace.
The following lines of code all do the same thing.
Lisp lovers will love this feature. Use as many parentheses as you want!
Lisp haters will also love it.
Bounties £££
There's a growing number of people attempting to build a DreamBerd compiler. We imagine that this update will decrease that number.
If you really want to make a DreamBerd compiler, we highly recommend that you target a smaller subset of the language. Please consider the following features optional:
const const const
serverFeel free to use a local store instead.
If your code has a compile-time error... but could potentially be 'un-errored' by adding more code... it's supposed to email me ([email protected]). But this kind of 'partial' parsing can be tricky. So feel free to ignore this, or only do it in certain cases.
If your code has a compile-time error... but could potentially be 'un-errored' by interpreting a certain part of it as a string... it's supposed to interpret the shortest possible amount of code as such. Again, this kind of 'possibility parsing' can be tricky. So feel free to ignore this, or only do it in a small number of cases.
As of today, all parentheses are optional. Their use can mostly be replaced by significant whitespace. For function calling, your parser now needs to figure out the signature of every function, so that it can figure out which arguments are being passed to it. This is quite hard! Feel free to require parentheses.
Unless otherwise stated, DreamBerd is the same as ECMAScript. But that can take a lot of work to parse and compile, especially when combined with the other tricky aspects. So I highly recommend just sticking to the functions and features that appear in the DreamBerd documentation.
Even when ignoring these, making a DreamBerd compiler can be hard!
Therefore, the DreamBerd Foundation will pay the following rewards for these accomplishments:
Or do both at once to win £198 outright!
Many thanks,
Lu Wilson, CEO of the DreamBerd Foundation, please pay me money so I can afford these bounties.
*no techbro charities
This discussion was created from the release (The (parentheses (update))).
Beta Was this translation helpful? Give feedback.
All reactions