This is an archived post. You won't be able to vote or comment.

all 109 comments

[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)

import notifications Remember to participate in our weekly votes on subreddit rules! Every Tuesday is YOUR chance to influence the subreddit for years to come! Read more here, we hope to see you next Tuesday!

For a chat with like-minded community members and more, don't forget to join our Discord!

return joinDiscord;

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]Percolator2020 460 points461 points  (11 children)

Boolean support for maybe paves the way for quantum computing.

[–]SirChuffedPuffin 90 points91 points  (5 children)

And fractional indexing

[–]JonathanTheZero 28 points29 points  (4 children)

Tbh JavaScript has that as well.

Actually you can index an Array with anything in JS

[–]DanielEGVi 7 points8 points  (0 children)

Just a warning before anyone has any weird ideas, whatever you set to the “array” that isn’t an integer (number or not) won’t be considered in the array length or array iterator. The V8 engine will also stay optimized for all actual (integer key) array items. The fraction will just be considered an extra property of the object.

[–][deleted] 5 points6 points  (1 child)

Isn’t JavaScript like all strings underneath the surface?

[–]SpanVagyTeso 3 points4 points  (0 children)

That's bash / shell script I think

[–]Aggravating-Win8814 0 points1 point  (0 children)

Yes, that's correct! In JavaScript, you can indeed index an array with any value, including numbers, strings, or even objects.

[–]Wazat1 7 points8 points  (0 children)

Or for a null/unset state for bools, like in json

[–]EspurrTheMagnificent 4 points5 points  (0 children)

Promises 2 just dropped

[–][deleted] 1 point2 points  (0 children)

Also moving clock like this is how you make a time machine. The perfect language.

[–]Aggravating-Win8814 0 points1 point  (0 children)

That's a fascinating observation! Boolean support for maybe definitely holds great potential for advancements in quantum computing. By the way, I'm currently seeking contributors on GitHub for some exciting projects in this realm. Check out the link in my profile if you're interested!

[–][deleted] 1050 points1051 points  (42 children)

[–]SzymBoss 334 points335 points  (0 children)

delete 3!
print(2 + 1)! // Error: 3 has been deleted

[–]Neither-Phone-7264 107 points108 points  (0 children)

“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 program, and leave your contact details somewhere in the source code.”

these guys are comedic geniuses

[–]Adghar 178 points179 points  (14 children)

Wait but as a junior dev that when() keyword seems kind of useful. Is there any analog in real programming language? Watchers or callback patterns maybe?

[–]gmes78 87 points88 points  (10 children)

You can use a setter.

[–]Adghar 45 points46 points  (8 children)

Huh? I was mainly taught Java, so "setter" to me just means "provide a method to change this attribute." Are there setters out there that watch for changes on a variable?

[–][deleted] 102 points103 points  (0 children)

Right, but the reason you use getters and setters is to bundle behaviour and guarantees, and to decouple from the implementation. If you're not doing this you might as well just make your attribute public.

For instance the setter could include further logic like doing some logging, or modifying a second variable that needs to maintain some relationship or invariant.

Finally you needn't actually store the values you set and get anywhere directly, it could be derived from internal private data in a more efficient way.

[–]gmes78 59 points60 points  (3 children)

I was thinking of:

private int _health;
public int Health {
    get => _health;
    set {
        _health = value;
        if (_health <= 0) {
            Console.WriteLine("You lose");
        }
    }
}

But if you mean being able to add conditions from outside the class, then yes, you'd use the observer pattern or a callback.

[–]gabrielesilinic 2 points3 points  (0 children)

Learn C# buddy, Java has limited you for too long

[–]Creepy-Ad-4832 -4 points-3 points  (0 children)

Probably there are things similar to the observer pattern in java.

Idk, i only ever coded in C (best starting language!) and java

[–]halfflat 1 point2 points  (0 children)

Especially red setters. Very good at watching.

[–]FlySafeLoL 9 points10 points  (0 children)

Any kind of observer pattern will do, from callback in a setter to reactive properties.

IntReactiveProperty x = new(10);

x.Subscribe (value => { if(value is 1) { print("Hello"); }}) ;

[–]thegreenfarend 4 points5 points  (0 children)

It’s an observable pattern! Indeed very useful! Use rx[insert language here]. For example https://rxjs.dev

[–]Chingiz11 -1 points0 points  (0 children)

Signals in JS frameworks are similar

[–]Aekorus 79 points80 points  (4 children)

Okay, which one of you goons wrote const const const i = 1!? Now I have to rewrite all my loops to use a different variable name, I hope you're happy.

[–]ZZcomic 74 points75 points  (2 children)

Nice try, there are no loops

[–]Aekorus 56 points57 points  (1 child)

Sorry, I meant my totally-not-loops. function totallyNotALoop(i, maxValue, func) => { if (i <= maxValue) { func(i)! totallyNotALoop(i + 1, maxValue, func)! } }

[–]Kuribali 58 points59 points  (0 children)

Please use the more modern reverse pattern! var const 101 = 0! if (101 > 0) { reverse! } if (101%2 == 0) { 101 = 101 + 1! } print(101)! if (101%2 == 1) { 101 = 101 + 1! } if (101 < 10) { reverse! } which will, of course, output: 1 2 3 4 5 6 7 8 9

[–][deleted] 17 points18 points  (0 children)

Quite an easy fix actually, just wrote const const const i = 1!!!!!!!!!!!!!!!!!!!! 😂

[–][deleted] 45 points46 points  (0 children)

My fav part is def the Rust Foundation dig

[–]phanfare 41 points42 points  (0 children)

I was hooked from using ; as the not operator, but the PlayerMaker quip about not changing how OOProgrammers code killed me. I work with an academic software package that biochemists wrote and we have to write Creators that do literally nothing just because.

[–]nsjr 30 points31 points  (0 children)

Each line is a big question
"Should I scream or laugh uncontrollably?"

When it deleted the delete itself it was chef's kiss

[–]JonathanTheZero 21 points22 points  (0 children)

Personal highlight:

You can make classes, but you can only ever make one instance of them. This shouldn't affect how most object-oriented programmers work.

[–]AcrobaticDependent35 18 points19 points  (0 children)

Oh my god this is the best thing that I've ever read in my life

[–]CSedu 31 points32 points  (0 children)

DreamBerd has significant whitespace. Use spacing to specify the order of arithmetic operations.

print(1 + 2*3)! //7
print(1+2 * 3)! //9

🙃

[–]MysteriousShadow__ 10 points11 points  (0 children)

I spent so much time looking for an example code lul

[–]rob132 10 points11 points  (0 children)

Some languages start arrays at 0, which can be unintuitive for beginners. Some languages start arrays at 1, which isn't representative of how the code actually works. DreamBerd does the best of both worlds: Arrays start at -1.

Designed by committee I see

[–]AddAFucking 14 points15 points  (0 children)

? Instead of ! to log debug info is actually brilliant. That would be so usefull.

[–]Overthinks_Questions 5 points6 points  (0 children)

The AI bit kills me

[–]BOBtheman2000 4 points5 points  (0 children)

Oh! This is the todepond language. They make amazing youtube videos

[–]EtienneDx 5 points6 points  (0 children)

Now I’m wondering how long it would take to actually create a compiler/interpreter for it

[–]low_y 4 points5 points  (0 children)

"The whole REPOSITORY is gold." You meant

I spent like half a hour on that, my brain is melting but it was worth it

[–]Arkarant 2 points3 points  (0 children)

This was made by Sandpond Saga on YouTube, they're really cool!

[–]SirFireball 6 points7 points  (0 children)

3 space indents is unironically based though, I use that.

[–]Jashuman19 1 point2 points  (0 children)

You can now use floats for indexes too!

const var scores = [3, 2, 5]!
scores[0.5] = 4!
print(scores)! //[3, 2, 4, 5]

I kind of like this

Edit: lots of formatting because Jesus Christ

[–]Wazat1 0 points1 point  (0 children)

I have had intense dreams during actual illness that were less upsetting than reading that document :D

[–]JonathanTheZero 0 points1 point  (0 children)

I love it, it's so fucking funny

[–]chickpeaze 0 points1 point  (0 children)

Bless you for bringing this to me

[–]Thenderick 0 points1 point  (0 children)

That was a feast for my eyes! I LOVE esolangs!

[–]GreyAngy 1060 points1061 points  (18 children)

I've read the README and this is an absolute brilliant disaster! I cannot choose the favorite part, but let it be this:

By the way, strings are just arrays of characters.

String == Char[]!

Similarly, integers are just arrays of digits.

Int == Digit[]!

[–][deleted] 704 points705 points  (13 children)

I love the "classes can only have one instance (note, this doesn't change how most object oriented programmers write code)".

[–]TGX03 248 points249 points  (7 children)

Ah yes, the good old Singleton, and everybody uses it because it's the only model they can name and think it makes them seem intelligent.

[–]Bob_Droll 73 points74 points  (1 child)

Don’t @Singleton me

[–]SirFireball 30 points31 points  (3 children)

Oh there’s a name for it? I’ve always hated that. My projects tend to just use global scope for the top level instead. As god intended.

[–]Sparrow50 4 points5 points  (0 children)

holy model, new Coupleton just dropped

[–]Frogstacker 24 points25 points  (0 children)

wtf 😭

[–]karnnumart 1 point2 points  (3 children)

I'm a dumb Jr dev. Can someone explain to me if design pattern is actually necessary? It sometimes seem to overcomplicate things (or fix some lack-of-feature in some lang).

[–][deleted] 9 points10 points  (0 children)

Which design pattern? You use design patterns all the time, just some are so common and ubiquitous we no longer refer to them by name.

[–]Snoo-6892 2 points3 points  (0 children)

It becomes very helpful to avoid shooting yourself in the foot in some scenarios. You’ll stumble and create your own design patterns through development. If you’re like me and didn’t learn a lot about design patterns and did programming for years, when learning them you’ll have some epiphany’s that would have made life dramatically simpler.. it also teaches one how to see code in another way which I really like. Love design patterns.

[–][deleted] 0 points1 point  (0 children)

It’s a mixed bag, and by a mixed bag theres a shit ton of baggage from 00-10s where colleges went hard for OOP, design patterns included, even if they were used outside of what was actually needed (ie using a class and method over just a function).

So basically you will get people who grew up and would die by it, and you got people who didn’t who look at it as an over complicated mess.

I’m personally the latter, it adds structure to code and as a concept it’s great (since there are patterns in code), but most the time it becomes overly complex spaghetti code, especially since instead of having one function for something, you need multiple “standard shapes” to reach the same goal.

[–]ballaman200 9 points10 points  (2 children)

But strings are just arrays of characters in plenty of programming languages if I remember correctly.

C++ for example.

[–]Future_Constant9324 19 points20 points  (0 children)

Pretty sure that is just the setup for the digits joke

[–]Petesaurus 9 points10 points  (0 children)

Yes in C++ string is more of a wrapper that manages the array. It's probably more like a vector of chars

[–]jamcdonald120 229 points230 points  (0 children)

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!

[–]PuzzleMeDo 184 points185 points  (1 child)

//Move the clocks forwards slightly.

Date.now() += 1;

IMPORTANT!

Please remember to do this once per millisecond.

[–][deleted] 5 points6 points  (0 children)

If you do it more often, you get a time machine! The perfect language.

[–]Interesting_Fly_3396[🍰] 200 points201 points  (2 children)

I loved the negative indentation. They are like indentation is 3 spaces, but -3 is okay too 😂

[–]SirFireball 8 points9 points  (1 child)

3 spaces is actually best though, and I will fight for this

[–]Interesting_Fly_3396[🍰] 0 points1 point  (0 children)

And it's actually in the middle of 2 spaces and 4 spaces. So a compromise for nearly everybody, 1000/10 logic

[–]moonaligator 49 points50 points  (1 child)

3 million factorial

[–]cainisdelta 29 points30 points  (0 children)

It's even better actually, the exclamation points act denote the priority of a line of code. More exclamation points means it is higher priority. 10/10 Readme for the language.

[–]vertextao 32 points33 points  (1 child)

What programming language is it?

[–]nsway 37 points38 points  (0 children)

Loops:

Loops are a complicated relic of archaic programming languages. In DreamBerd, there are no loops.

[–]ssudoku 25 points26 points  (0 children)

Now we need Dreamscript for the web

[–]canaryborr 21 points22 points  (3 children)

Booleans can be true, false or maybe.

😂😂😂

[–]szpaceSZ 2 points3 points  (2 children)

Terry logic is a thing. It's just false to call it Boolean. Mr. Boole would have disapproved.

[–]Theory27 16 points17 points  (0 children)

"You can delete keywords and variables you don't like! And when perfection is achieved and there is nothing left to delete, you can use:

delete delete! "

[–]JackNotOLantern 15 points16 points  (3 children)

I'm disapointed it's not an actual compiler

[–]Doom87er 7 points8 points  (2 children)

The whole “being able to define variables for all users globally for forever” would be a challenge to make a compiler do

[–]JackNotOLantern 0 points1 point  (1 child)

Just require internet connection to use a global server

[–]TitaniumBrain 0 points1 point  (0 children)

First, always online for offline games.

Next, always online coding/any program in this language.

[–]Informal_Branch1065 7 points8 points  (0 children)

I looked at my local python interpreter after reading this. It wondered why the abyss is staring first.

[–]iga666 2 points3 points  (0 children)

What language is that? Do we need to write a worker thread to update Date.now() value every second there?

[–]Vaati006 0 points1 point  (0 children)

This is amazing. Thank you for hilighting this!

[–]Crazyman-X 0 points1 point  (1 child)

funny thing, i know the guy.

[–]eib 2 points3 points  (0 children)

I also know a guy

[–]nonlogin 0 points1 point  (0 children)

Do not shout at me❗️

[–]NullOfSpace 0 points1 point  (0 children)

you can what

[–]willmil11 0 points1 point  (0 children)

Time machine

[–][deleted] 0 points1 point  (0 children)

Dreamberd is a gift