logoalt Hacker News

Toit v2.0.0

87 points • by floitsch • last Sunday at 12:25 AM • 28 comments • view on HN

Comments

draven • today at 8:12 AM

The wikipedia page https://en.wikipedia.org/wiki/Toit is short but still gives a lot of context.

➕ show 2 replies
heavensteeth • today at 10:17 AM

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.
➕ show 1 reply
thomascountz • today at 7:49 AM

   Toit is a language for writing scripts on your computer and applications on your ESP32. A readable syntax, an efficient runtime, and tools that work together.

   Free and open source. Maintained by volunteers.
➕ show 1 reply
jacobgorm • today at 7:53 AM

The people behind Toit are the original people behind the V8 VM in Chrome. They know their stuff.

➕ show 3 replies
maxloh • today at 7:58 AM

Here's a beginner tutorial for the language: https://docs.toit.io/language/toitversus

Nice syntax. It looks like how we'd design programming if C had never existed.

  add a/int b/int -> int:
    return a + b
  
  main:
    print (add 2 3)  // Prints 5.
benrutter • today at 8:55 AM

Looks interesting! I can't tell really from the docs the untended use case though. It says "scripts", but also " applications".

Most importantly though (/s), is this toit as in "roof" in French, toit as in "to it", or otherwise?

➕ show 1 reply
_s_a_m_ • today at 10:37 AM

The last thing this planet needs a new programming language

vim-guru • today at 9:01 AM

Looks quite nice

mi_lk • today at 8:15 AM

Who is using this? The company originally behind it has shut down

➕ show 1 reply
Hamuko • today at 9:07 AM

Is there some kind of an advertising blurb for why you’d want to use Toit, especially for scripting? I think the only thing I saw was “a readable language”, but I’d probably consider Python more readable than it judging from the examples.

➕ show 1 reply