S01E52 — 18-09-2024.
Salon de thé.
jour 52.
Rejoindre des groupes discord a vraiment été un bon choix de ma part, surtout des groupes où les personnes aiment créer des projets from scratch peu importe la difficulté. C’est un truc dont j’ai besoin d’avoir autour de moi d’autres créateurs, ça stimule ma créativité et me challenge. Puis le fait de pouvoir converser autour de la syntaxe, je suis aux anges.
Par exemple, tout à l’heure sur le discord de Context Free, Revenger Wizard, le créateur de Teascript, nous a demandé notre opinion concernant un choix de syntaxe. Je n’te dis pas comment, j’étais heureux de pouvoir échanger de ce sujet et tenter de l’aider. Des choses simples qui donnent du baume au cœur. Je pourrai converser compilo pendant des heures tellement c’est passionnant. Langue de Shakespeare oblige :
Conversation discord entre Revenger Wizard, Tom, IgneousRed et l’invisageable personnage.
-Revenger Wizard:
Anyone got opinions about the syntax of blocks in Go or Rust?
if true { print("hi") }
for var x in something { }
Mostly about removing ( and ) from around the conditions and only allowing { } blocks. I was thinking of going the same route since it might be easier to understand and nicer to read compared to C.
-Tom:
When bouncing back and forth between languages, I make mistakes, but overall, I like this Go/Rust style better.
-IgneousRed:
I thought not having () around if was dumb, but now I find it much nicer.
I approve of always using {} and that makes the use of () optional, whitch is nice.
-invisageable:
I also prefer without parenthesis but your syntax is quite similar to JS so for JS/TS user wanted to do embedded stuff, it should be familiar to start using your langage. however if you choose the without parenthesis approach — do not forget to apply it for while.
also what’s your approach regarding for(var i = 1; i < 100; i++) ? maybe you could delete it in favor of for in.
-Revenger Wizard:
At first I was thinking about removing it, but I thought it might be useful for certain stuff. And also because for(var i in 0..10) does an allocation for the range. The for in applies better for iterating over collections I’d say.
One small detail I’ll definitely change about the C style loop would be to avoid running the condition i < 100 at every iteration, since it turns out it’s harder to JIT compile (I think).
And also allowing multiple variables and conditions being declared
Some of my friends say the syntax is a bit too much similar to JS/TS, so slightly making it different might help
-invisageable:
I understand the use case but do not loose your syntax consistency just to be different than JS/TS. if you decide to not remove the C style loop, as a user I will need to remember if this for loop needs parenthesis or not. AssemblyScript do not care to be fully JS/TS compliant. After all, as a language designer you can do whatever you want
so you can ignore what i’m saying
-Revenger Wizard:
Nah, I love reading other’s opinions :)
Mostly because if I only allow { } blocks the parens around conditions become sort of superfluous. Plus less parens overall. I think the 2 loops in Teascript would become:
for var x in collection { print(x) }
for var x = 0; x < 10; x++ { print(x) }
C style loop requires = declaration so it’s easy to distinguish the twos
-invisageable:
Sounds good, now it makes sense — semicolons bother but that’s just a detail. I try to play with your syntax to find an alternative but it’s too verbose. the idea was to replace semi ; with keyword:
for var x = 0 until x < 10 then x++ { print(x) }
the wording is not right but I hope you get it
Fin de la conversation.
Ce que j’aime, c’est que chacun peut donner son opinion sans que cela soit mal prit. Chacun apporte sa vision, donne des pistes, tout ça pour lui permettre de conserver une cohérence en terme de syntaxe. Cet échange peu te paraître anodin, mais c’est de l’or en barre. En à peine quelques minutes, il vient de gagner du temps. Bonne chance à lui et son langage.