News for hackers. Stuff that matters.
Re:Toit v2.0.0 by heavensteeth on Tuesday November 03, 2026 @05:17AM (#50350124)
This seems very interesting. It almost looks/feels like Pythonic Go.

There's already another syntax example in the thread, but I want to point out the weirdest syntax I've seen yet: positional arguments look like posix command arguments:

   greet name/string="World" --greeting/string="Hello" -> string:
     return "$greeting $name"

   main:
     print (greet)                         // Prints Hello World.
     print (greet "Ada" --greeting="Hi")    // Prints Hi Ada.
Re:Toit v2.0.0 by kasperl on Tuesday November 03, 2026 @05:31AM (#50350236)
Arguments like --greeting are the named arguments:

https://docs.toit.io/language/beginner/lists-and-functions/#...

The name argument is positional here.

Re:Toit v2.0.0 by IanCal on Tuesday November 03, 2026 @07:08AM (#50350982)
Feedback for the doc writers on this then, the phrase in my head of "the name of the named argument is greeting, name is not named" is a little awkward.
Re:Toit v2.0.0 by kasperl on Tuesday November 03, 2026 @08:43AM (#50351892)
:)
Re:Toit v2.0.0 by skybrian on Tuesday November 03, 2026 @09:45AM (#50352643)
It’s probably fine once you’re used to it, but I’m not sure that embedded development is the place to innovate on function call syntax.

Then again, nowadays, it’s not like you have to write code yourself.