The only arguments I’ve heard for disallowing - as an identifier constituent character is that you would want hello-world to be treated as subtraction, but like … why? Why define your syntax in a way that optimizes for saving characters over clarity? Are you trying to make your language more competitive for obfuscated code contests? Well, stop it!
Space out your subtraction; give it some room to breathe.
There’s a difference between what I type and what I want to read, and I think that’s relevant here. As I’m typing code, I’ll often write something like hello-world*5/foobar and expect my formatter to turn it into something readable. That wouldn’t be possible if names can include dashes.
Also, from experience playing around with Koka, the implementation there made it often difficult to include numbers in names. For example, hello-2 was disallowed. This could just be an implementation detail for Koka identifiers, but it was the sort of small irritation that I think inherently comes when you step away from established norms. It’s something you could get used to, but I’ve never felt particularly limited by the inability to write hello-world as a single identifier.
from experience playing around with Koka, the implementation there made it often difficult to include numbers in names. For example, hello-2 was disallowed.
That’s just a design mistake in that particular language; most kebab-case languages don’t have that problem.
It’s something you could get used to, but I’ve never felt particularly limited by the inability to write hello-world as a single identifier.
That’s probably because you haven’t gotten used to it. Once you do, going back is especially irritating once you understand how pointless it is.
I think the tooling should know which of hello-world or hello and world are defined and be able to format appropriately. Forbidding dashes in names just for one situation seems like overkill. Plus, it’s not like there’s no prior art for this situation - OCaml’s comments / infix multiply come to mind.
No thanks! I want my formatters to be simple: parse the file into a CST, and generate a correct formatting from that CST. Figuring out what variables are in scope at a given point feels like the job of a very different piece of machinery. KISS and all that jazz.
I agree that this probably isn’t the biggest issue in the world, but I wanted to specifically add an example of using infix operators without spaces, and how kebab case identifiers would break my flow. It’s something that could be relearned, and, like you say, other syntaxes deal with minor niggles like this just fine.
I am interested in them, but the more I read about the language the more I like it for its own sake. I haven’t actually used it yet, but on paper, it’s got most of the things I want and no obvious deal breakers.
…aside from being interpreted, of course. But for a lot of use cases it seems great.
Sort of, in that it’s class-based and everything is an object and it has block-based control structures. There are quite a few languages like that, e.g. Ruby.
But it has types and type-checking, and method calls are a mix of positional and named parameters, and it doesn’t appear to allow the kind of dynamic hijinks ST does, like reflection and modifying classes at runtime, which makes sense since it’s focused on tiny devices.
Well, those other languages got those “Ruby-like” features from Smalltalk, including Ruby itself.
And there were and are Smalltalks with type-checking, for example Strongtalk. Which Lars Bak, one of the principal developers of Toit worked on.
Lars Bak and Kasper Lund also worked on Resilient Smalltalk, an embedded Smalltalk for tiny devices. I am guessing that OOVM Smalltalk was an earlier version of that work.
I think Toit is clearly a further development of that earlier work.
I dunno, at this point saying a language was influenced by Smalltalk is like saying a band is influenced by the Velvet Underground. Like, everything is, y’know?
You did get the part where it’s the exact same people? Who first worked on an embedded Smalltalk together before working for Google on VMs, and then left Google together to work on a Smalltalk-inspired language. Hmmm…
So it’s more like saying The Velvet Underground is influenced by The Velvet Underground.
Ohhhh, okay. Even this the first three times I read as “a” “round” “toit” (rhymes with “toy”) so I guess it’s a language environment thing. (“toit” is a word in the country I live in, it means “food”.)
Common is relative to many factors I suppose :D First time hearing of it for me (and my dad loved bad puns, so if anyone would’ve had one ..!). Thank you for sharing!
This is delightful. Also, I’ve been looking into useful-but-cute languages for years at this point but I am always amazed to still find something great that I hadn’t seen before out there.
I’m not interested in microcontrollers, but I’ve found the language cute. To me, it looks like an unexpected child of Ruby, Go and… Makefile?
I like the syntax for creating a variable without a value.
Kebab case is also a fun choice
The only arguments I’ve heard for disallowing - as an identifier constituent character is that you would want
hello-worldto be treated as subtraction, but like … why? Why define your syntax in a way that optimizes for saving characters over clarity? Are you trying to make your language more competitive for obfuscated code contests? Well, stop it!Space out your subtraction; give it some room to breathe.
There’s a difference between what I type and what I want to read, and I think that’s relevant here. As I’m typing code, I’ll often write something like
hello-world*5/foobarand expect my formatter to turn it into something readable. That wouldn’t be possible if names can include dashes.Also, from experience playing around with Koka, the implementation there made it often difficult to include numbers in names. For example,
hello-2was disallowed. This could just be an implementation detail for Koka identifiers, but it was the sort of small irritation that I think inherently comes when you step away from established norms. It’s something you could get used to, but I’ve never felt particularly limited by the inability to writehello-worldas a single identifier.That’s just a design mistake in that particular language; most kebab-case languages don’t have that problem.
That’s probably because you haven’t gotten used to it. Once you do, going back is especially irritating once you understand how pointless it is.
I think the tooling should know which of
hello-worldorhelloandworldare defined and be able to format appropriately. Forbidding dashes in names just for one situation seems like overkill. Plus, it’s not like there’s no prior art for this situation - OCaml’s comments / infix multiply come to mind.No thanks! I want my formatters to be simple: parse the file into a CST, and generate a correct formatting from that CST. Figuring out what variables are in scope at a given point feels like the job of a very different piece of machinery. KISS and all that jazz.
I agree that this probably isn’t the biggest issue in the world, but I wanted to specifically add an example of using infix operators without spaces, and how kebab case identifiers would break my flow. It’s something that could be relearned, and, like you say, other syntaxes deal with minor niggles like this just fine.
I am interested in them, but the more I read about the language the more I like it for its own sake. I haven’t actually used it yet, but on paper, it’s got most of the things I want and no obvious deal breakers.
…aside from being interpreted, of course. But for a lot of use cases it seems great.
More a variant of Smalltalk.
Sort of, in that it’s class-based and everything is an object and it has block-based control structures. There are quite a few languages like that, e.g. Ruby.
But it has types and type-checking, and method calls are a mix of positional and named parameters, and it doesn’t appear to allow the kind of dynamic hijinks ST does, like reflection and modifying classes at runtime, which makes sense since it’s focused on tiny devices.
Well, those other languages got those “Ruby-like” features from Smalltalk, including Ruby itself.
And there were and are Smalltalks with type-checking, for example Strongtalk. Which Lars Bak, one of the principal developers of Toit worked on.
Lars Bak and Kasper Lund also worked on Resilient Smalltalk, an embedded Smalltalk for tiny devices. I am guessing that OOVM Smalltalk was an earlier version of that work.
I think Toit is clearly a further development of that earlier work.
I dunno, at this point saying a language was influenced by Smalltalk is like saying a band is influenced by the Velvet Underground. Like, everything is, y’know?
You did get the part where it’s the exact same people? Who first worked on an embedded Smalltalk together before working for Google on VMs, and then left Google together to work on a Smalltalk-inspired language. Hmmm…
So it’s more like saying The Velvet Underground is influenced by The Velvet Underground.
No, sorry, I missed that!
Lisp-case makes sense in Lisp/Scheme (Polish notation languages, in general) or e.g. in XML or in file names sometimes.
I can recommend reading the Toit articles hash maps that don’t hate you (later adopted by TruffleRuby) and sorting algorithms that don’t hate you.
I kept looking for a “round” joke, but I never found it. Did I just miss it?
Me too, and no.
Maybe they’re still planning to add the joke to the docs…
I’ll bet I can guess when they will…
I’ve heard one of the devs talk about it, and he pronounces it like “toy-t” rather than “too-it”
Thanks! I keep wondering about that. I guess the name is a mixup of “IoT”.
I don’t get why there would be one. Help?
Because it will be funny, if anyone ever gets A ROUND TOIT.
Ohhhh, okay. Even this the first three times I read as “a” “round” “toit” (rhymes with “toy”) so I guess it’s a language environment thing. (“toit” is a word in the country I live in, it means “food”.)
The usual spelling of the joke is “tuit” to make the pronunciation clearer.
My dad had a large brass coin with Toit stamped on it. It’s a common novelty gift.
Common is relative to many factors I suppose :D First time hearing of it for me (and my dad loved bad puns, so if anyone would’ve had one ..!). Thank you for sharing!
This is delightful. Also, I’ve been looking into useful-but-cute languages for years at this point but I am always amazed to still find something great that I hadn’t seen before out there.
This looks really nice. And what a timing..