Skip to content

v0.9.9.9.9.9.9.9.9b

Compare
Choose a tag to compare
@TodePond TodePond released this 03 Jun 16:56
· 365 commits to main since this release
39fa198

Earlier this week, DreamBerd was secretly featured on the latest Future of Code podcast episode. I only wish that they had invited me onto the show! There were quite a few points where I really wanted to interrupt them and give my opinion. But alas — maybe next time!

To celebrate the occasion, a new DreamBerd update is here!

Read on for the notes 𓀉

New Feature: AI

DreamBerd features AEMI, which stands for Automatic-Exclamation-Mark-Insertion.

If you forget to end a statement with an exclamation mark, DreamBerd will helpfully insert one for you!

print("Hello world") // This is fine

Similarly... DreamBerd also features ABI, which stands for Automatic-Bracket-Insertion.

If you forget to close your brackets, DreamBerd will pop some in for you!

print("Hello world" // This is also fine

Similarly.... DreamBerd also features AQMI, which stands for Automatic-Quotation-Marks-Insertion.

If you forget to close your string, DreamBerd will do it for you!

print("Hello world // This is fine as well

This can be very helpful in callback hell situations!

addEventListener("click", (e) => {
    requestAnimationFrame(() => {
        print("You clicked on the page
        
        // This is fine

Similarly..... DreamBerd also features AI, which stands for Automatic-Insertion.

If you forget to finish your code, DreamBerd will auto-complete the whole thing!

print( // This is probably fine

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.

New Feature: Signals

To make a signal, use use.

const var score = use(0)!

When it comes to signals, the most important thing to discuss is syntax.

In DreamBerd, you can set (and get) signals with just one function:

const var score = use(0)!

score(9)! // Set the value
score()?  // Get the value (and print it)

Alternatively, you can be more explicit with your signal syntax, by splitting it into a getter and setter.

const var [getScore, setScore] = use(0)!

setScore(9)! // Set the value
getScore()?  // Get the value (and print it)

Technical info: This is pure syntax sugar. The split signal functions are exactly the same as before.

const var [getScore, setScore] = use(0)!

getScore(9)! // Set the value
setScore()?  // Get the value (and print it)

Of course, this means that you can carry on splitting as much as you like...

const var [getScore, setScore] = use(0)!
const var [retrieveScore, updateScore] = getScore!
const var [calculateScore, assignScore] = updateScore!

New Feature: Signals Sugar

The great thing about signals is that they let you work in real DreamBerd, instead of relying on frameworks.

For this reason, there's some additional syntax sugar that gets compiled away in a build step.

You can use signals as if they're just a value.

const var score = use(0)!
score = 9!
print(score)! // 9

If you want to be more explicit, you can use the value property instead.

const var score = use(0)!
score.value = 9!
print(score.value)! // 9

Technical info: The value property doesn't do anything. It just returns the signal again.

const var score = use(0)!

score.value(9)! // Set the value
score.value()?  // Get the value (and print it)

score.value.value = 99!
print(score.value.value.value)! // 99

Thank you for all your contributions to DreamBerd!
Sorry for not merging your PRs - I like to keep a few open for the semblence of an active community.

Please note: As a matter of policy, I only keep open issues with unreproducible steps. Otherwise, I'll just close them! GRRRR >:(

If you would like to help, please take a look at some of the higher priority issues!