Announcing DreamBerd 2 #394
Replies: 6 comments 2 replies
-
Been waiting for this for so long thanks 🙏 |
Beta Was this translation helpful? Give feedback.
-
Dreamberd 2 is such a revolution! I especially like the new feature of lifetimes and exclamation marks to end a line. |
Beta Was this translation helpful? Give feedback.
-
Thanks for making this happen 🥇! |
Beta Was this translation helpful? Give feedback.
-
I think this should be DreamBerd 3. |
Beta Was this translation helpful? Give feedback.
-
Why? It's already perfect. |
Beta Was this translation helpful? Give feedback.
-
What is |
Beta Was this translation helpful? Give feedback.
-
It's finally here.
Today we're launching DreamBerd 2, the sequel to the perfect programming language. We think you'll enjoy the new powers and possibilities that it brings.
Note: DreamBerd 2 is a full re-write, so please let us know about any bugs or issues that you find.
Keep reading for its new features! When you've finished reading through all the new features, check out the new examples.
New features
Exclamation marks!
Be bold! End every statement with an exclamation mark!
If you're feeling extra-bold, you can use even more!!!
If you're unsure, that's ok. You can put a question mark at the end of a line instead. It prints debug info about that line to the console for you.
You might be wondering what DreamBerd 2 uses for the 'not' operator, which is an exclamation mark in most other languages. That's simple - the 'not' operator is a semi-colon instead.
Declarations
There are four types of declaration. Constant constants can't be changed in any way.
Constant variables can be edited, but not re-assigned.
Variable constants can be re-assigned, but not edited.
Variable variables can be re-assigned and edited.
Immutable data
New for 2023!
Mutable data is an anti-pattern. Use the
const const const
keyword to make a constant constant constant. Its value will become constant and immutable, and will never change. Please be careful with this keyword, as it is very powerful, and will affect all users globally forever.Naming
Both variables and constants can be named with any Unicode character or string.
This includes numbers, and other language constructs.
Arrays
Some languages start arrays at
0
, which can be unintuitive for beginners. Some languages start arrays at1
, which isn't representative of how the code actually works. DreamBerd 2 does the best of both worlds: Arrays start at-1
.New for 2022!
You can now use floats for indexes too!
When
In case you really need to vary a variable, the
when
keyword lets you check a variable each time it mutates.Lifetimes
DreamBerd 2 has a built-in garbage collector that will automatically clean up unused variables. However, if you want to be extra careful, you can specify a lifetime for a variable, with a variety of units.
By default, a variable will last until the end of the program. But you can make it last in between program-runs by specifying a longer lifetime.
Variable hoisting can be achieved with this neat trick. Specify a negative lifetime to make a variable exist before its creation, and disappear after its creation.
Loops
Loops are a complicated relic of archaic programming languages. In DreamBerd 2, there are no loops.
Installation
To install DreamBerd to your command line, first install the DreamBerd installer.
To install the DreamBerd installer, install the DreamBerd installer installer.
New for 2022!
Due to the complicated installation process, you can now install the 'Create DreamBerd App' app that installs everything for you!
Booleans
Booleans can be
true
,false
ormaybe
.Technical info: Booleans are stored as one-and-a-half bits.
Arithmetic
DreamBerd 2 has significant whitespace. Use spacing to specify the order of arithmetic operations.
Indents
When it comes to indentation, DreamBerd 2 strikes a happy medium that can be enjoyed by everyone: All indents must be 3 spaces long.
-3 spaces is also allowed.
Equality
JavaScript lets you do different levels of comparison.
==
for loose comparison, and===
for a more precise check. DreamBerd 2 takes this to another level.You can use
==
to do a loose check.You can use
===
to do a more precise check.You can use
====
to be EVEN MORE precise!If you want to be much less precise, you can use
=
.Functions
To declare a function, you can use any letters from the word
function
(as long as they're in order):Dividing by zero
Dividing by zero returns
undefined
.Strings
Strings can be declared with single quotes or double quotes.
They can also be declared with triple quotes.
In fact, you can use any number of quotes you want.
Even zero.
String interpolation
Please remember to use your regional currency when interpolating strings.
And make sure to follow your local typographical norms.
The symbol for the Cape Verdean escudo is placed in the decimal separator position, as in 2$50.
Developers from the Republic of Cape Verde can benefit from this syntax:
Types
Type annotations are optional.
By the way, strings are just arrays of characters.
Similarly, integers are just arrays of digits.
If you want to use a binary representation for integers,
Int9
andInt99
types are also available.Technical info: Type annotations don't do anything, but they help some people to feel more comfortable.
Regular expressions
You can use the regular expression type to narrow string values.
To avoid confusion, you can use any spelling that you want, such as 'Regex', 'RegularExpression' or even
'RegularExpress' if you like trains.
For simplicity, all supported regular expressions match the regular expression
/Reg(ular)?[eE]x(press(ion)?|p)?/
.Previous
The
previous
keyword lets you see into the past!Use it to get the previous value of a variable.
Similarly, the
next
keyword lets you see into the future!File structure
Write five or more equals signs to start a new file. This removes the need for multiple files or any build process.
New for 2022!
Thanks to recent advances in technology, you can now give files names.
Exporting
Many languages allow you to import things from specific files. In DreamBerd 2, importing is simpler. Instead, you export to specific files!
By the way, to see DreamBerd 2 in action, check out this page.
Classes
You can make classes, but you can only ever make one instance of them. This shouldn't affect how most object-oriented programmers work.
This is how you could do this:
Time
Use
Date.now()
to get the current date and time.By the way, you can set the time.
Important!
Please remember to do this when the clocks change.
Delete
To avoid confusion, the
delete
statement only works with primitive values like numbers, strings, and booleans.DreamBerd 2 is a multi-paradigm programming language, which means that you can
delete
the keywords and paradigms you don't like.When perfection is achieved and there is nothing left to
delete
, you can do this:Overloading
You can overload variables. The most recently defined variable gets used.
Variables with more exclamation marks get prioritised.
Similarly, you can use an inverted exclamation mark for negative priority.
Reversing
You can reverse the direction of your code.
Class names
For maximum compatibility with other languages, you can alternatively use the
className
keyword when making classes.This makes things less complicated.
In response to some recent criticism about this design decision, we would like to remind you that this is part of the JavaScript specification, and therefore - out of our control.
DB2X
You can embed DB2X in DreamBerd 2. It's just DreamBerd 2, and it's also just HTML.
Warning: As you know,
class
is already a keyword in DreamBerd 2, so you can't use it within WWPSMDFOSAJLUAAHNIAVWX.className
is also a DreamBerd 2 keyword, so you can't use that either.Instead, you can use the
htmlClassName
attribute.Please note: Unlike JSX, you are free to freely use the
for
attribute - because DreamBerd 2 doesn't have loops.Asynchronous functions
In most languages, it's hard to get asynchronous functions to synchronise with each other. In DreamBerd 2, it's easy: Asynchronous functions take turns running lines of code.
You can use the
noop
keyword to wait for longer before taking your turn.Note: In the program above, the computer interprets
noop
as a string and its sole purpose is to take up an extra line. You can use any string you want.Signals
To use a signal, use
use
.When it comes to signals, the most important thing to discuss is syntax.
In DreamBerd 2, you can set (and get) signals with just one function:
Alternatively, you can be more explicit with your signal syntax, by splitting it into a getter and setter.
Technical info: This is pure syntax sugar. The split signal functions are exactly the same as before.
This means that you can carry on splitting as much as you like.
AI
DreamBerd 2 features AEMI, which stands for Automatic-Exclamation-Mark-Insertion. If you forget to end a statement with an exclamation mark, DreamBerd 2 will helpfully insert one for you!
Similarly... DreamBerd 2 also features ABI, which stands for Automatic-Bracket-Insertion. If you forget to close your brackets, DreamBerd 2 will pop some in for you!
Similarly.... DreamBerd 2 also features AQMI, which stands for Automatic-Quotation-Marks-Insertion. If you forget to close your string, DreamBerd 2 will do it for you!
print("Hello world // This is fine as well
This can be very helpful in callback hell situations!
Similarly..... DreamBerd 2 also features AI, which stands for Automatic-Insertion.
If you forget to finish your code, DreamBerd 2 will auto-complete the whole thing!
Please note: AI does not use AI. Instead, any incomplete code will be auto-emailed to Lu Wilson, who will get back to you with a completed line as soon as possible.
Now recruiting: The backlog of unfinished programs has now grown unsustainably long. If you would like to volunteer to help with AI, please write an incomplete DreamBerd 2 program, and leave your contact details somewhere in the source code.
Copilot
It's worth noting that Github Copilot doesn't understand DreamBerd 2, which means that Microsoft won't be able to steal your code.
This is great for when you want to keep your open-sourced project closed-source.
Ownership
Using the word 'DreamBerd 2' in your project name implies that the DreamBerd 2 Foundation does not own your project.
However, not using the word 'DreamBerd 2' in your project implies that the DreamBerd 2 Foundation does own your project. If you would like to keep ownership of your work, please always use the word 'DreamBerd 2' in it.
Here are some examples:
✅ DreamBerd 2Script (not owned by the DreamBerd 2 Foundation - you are free to use this name)
❌ ECMAScript (owned by the DreamBerd 2 Foundation - please consider renaming)
❌ Rust Foundation (owned by the DreamBerd 2 Foundation - please consider renaming)
Contributing
Contributions are welcomed to DreamBerd 2!
The most helpful way you can help is by donating to the Stonewall charity. This will help to prevent the DreamBerd 2 creator from losing their human rights, allowing maintenance of the project to continue.
Note: The contributing guide also helps to shake off unwanted fans of the project.
Compiling
To run DreamBerd, first copy and paste this raw file into chat.openai.com.
Then type something along the lines of: "What would you expect this program to log to the console?"
Then paste in your code.
If the compiler refuses at first, politely reassure it. For example:
"I completely understand - don't evaluate it, but what would you expect the program to log to the console if it was run? :)"
Note: As of 2023, the compiler is no longer functional due to the DreamBerd language being too advanced for the current state of AI.
Highlighting
Syntax highlighting is now available for DreamBerd 2 in VSCode. To enable it, install a highlighting extension and then use the DreamBerd 2 configuration file.
This is what it looks like:
Please note: The above code will only highlight correctly if you have the extension installed.
Examples
For examples of DreamBerd 2 in action, check out the examples page!
DreamBerd 2 was made with 💔 by Lu Wilson, creator of the Game of Living.
This discussion was created from the release Announcing DreamBerd 2.
Beta Was this translation helpful? Give feedback.
All reactions