Toit v2.0.0

(toit.io)

129 points | by floitsch 3 days ago ago

41 comments

  • draven 4 hours ago ago

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

    • ilvez 4 hours ago ago

      Just a joking side note: switch n to t in the URL and you get article for food in Estonian: https://et.wikipedia.org/wiki/Toit

    • no_time 4 hours ago ago

      >In February 2019, the company raised DKK 23 million (approximately US$3.5 million) in seed funding from Swedish venture capital firm Creandum.[4] Early versions required cloud registration to deploy code to devices.[5]

      DNS blackhole the domain and run.

      • unsnap_biceps 3 hours ago ago

        > The commercial cloud offering was later discontinued. Development of fleet-management tooling continued through an open-source project called Artemis, built on Supabase and PostgreSQL, which users self-host.[8]

        > According to Denmark's Central Business Register, Toitware ApS ceased operating in 2024.[9] Development of the language continues as a community project on GitHub.

        Seems unlikely to be a bait and switch at this point

        • no_time 3 hours ago ago

          whoops, black and white thinking burns me once more.

  • thomascountz 5 hours ago ago

       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.
    • skrebbel 5 hours ago ago

      Even after reading that (and more of the homepage) I have no idea what this is.

      • self 3 hours ago ago

        Think of it as a runtime + scheduler that you deploy programs to ESP32 devices. It gives you the ability to run multiple programs simultaneously (with isolation) and remote updates. The language compiles to bytecode; the developers have lots of experience writing VMs for constrained devices; see https://www.theregister.com/software/2004/07/27/forgotten-la... for something that predates V8 and Dart.

        • Rohansi an hour ago ago

          You get almost all of that with the more common language options too (MicroPython, NodeMCU/Lua, Espruino/JS). What makes this custom language better?

          • floitsch an hour ago ago

            We looked at these when we started. The problem with them is that they weren't designed with constrained resources in mind and it shows. For example, objects are hash tables and method calls are thus expensive. An obligatory top level execution makes startup slow, ...

            If you have a bigger machine you can optimize some of this (V8), but these optimizations typically need memory and/or a JIT. (And Python struggles to optimize even on stronger machines).

            By starting from scratch (with what we learned from V8 and Dart) you can design something that feels similar but is much cleaner and faster to run.

        • vanderZwan an hour ago ago

          Tangent: what an appropriate username :)

      • 4 hours ago ago
        [deleted]
  • maxloh 5 hours ago ago

    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.
  • jacobgorm 5 hours ago ago

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

    • vanderZwan 4 hours ago ago

      Those were it's creators, are they still involved after the company folded?

      Because if not, that might explain the lack of marketing around it.

      • floitsch 4 hours ago ago

        Kasper and I are still working on it.

        • vanderZwan an hour ago ago

          Very happy to hear that! I don't work in embedded but really like the language design of Toit. Hope it'll get a second chance, it feels like it flew under the radar a bit when it came out.

    • MrBuddyCasino 5 hours ago ago

      They should write this prominently on their website. It doesn’t radiate trustworthiness/substance/reputation. Also performance and resource requirements should be prominent when targets are MCUs.

    • Imustaskforhelp 4 hours ago ago

      Also co-founding Dart. They definitely know their stuff.

      • pjmlp an hour ago ago

        Dart v1.0, they had nothing to do with Dart v2.0, and the change in language semantics was the main reason folks like Gilad Bracha left the team.

      • jimbob45 3 hours ago ago

        Dart should have enjoyed the popularity that TypeScript received. Tough to compete with Hejlsberg though.

        • vanderZwan an hour ago ago

          Yeah, but Lars Bak isn't exactly a nobody when it comes to computer science either. Although I guess Bak is more famous for the implementation of programming languages than their design.

          Aside: funny how Dart and TS both have Danish creators.

          https://en.wikipedia.org/wiki/Anders_Hejlsberg

          https://en.wikipedia.org/wiki/Lars_Bak_(computer_programmer)

        • pjmlp an hour ago ago

          Google politics, Dart is only around thanks to AdWords team, and Flutter.

          Jetpack Compose was created by Android team exactly as counter reaction to Flutter.

          Go got lucky with their internal advocacy, and the push to rewrite Kubernetes from Java into Go.

          Google isn't exactly known for great programming language design, contrary to runtime implementations.

        • latexr 2 hours ago ago

          I may be misremembering, but my recollection is that Dart was written off in large part because of Google. Distrust with them was already high as they were abusing their dominance with things like AMP, and people felt it was a bad idea to give them even more control over the web.

  • heavensteeth 2 hours ago ago

    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.
  • close2 36 minutes ago ago

    I have used toit in a lot of my projects. It is a really nice language and so much cleaner than all the alternatives I have tried (Arduino, Python, Lua).

    The tools just work and I got used to the language really quickly.

    I did hate that it was bytecode. It just felt wrong to run bytecode on an ESP32. OTOH it just works, and I have never noticed any performance problems.

    My latest project is a controller for a slave-clock: https://gitlab.com/close2/nebenuhr-toit (There is also a Garmin repository that allows me to control the clock using my Garmin watch.)

    Full disclosure: I had to use toit (floitsch is my brother), but it really is a nice language and development environment.

    [Edit: typos..]

    • kasperl 14 minutes ago ago

      I just started working on a compile-to-native approach you might appreciate :)

  • benrutter 4 hours ago ago

    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?

    • floitsch 3 hours ago ago

      It's from Austin Powers.

      "toit like a tiger"

      https://youtu.be/gu31VyXlTzo

      • benrutter 2 hours ago ago

        Ahaha! I'd been thinking it was pronounced as in French (a bit like "twah") when I should be saying it in Mike Myer's super authentic Dutch accent!

      • mi_lk 27 minutes ago ago

        now we're talking.

  • vim-guru 4 hours ago ago

    Looks quite nice

  • mi_lk 4 hours ago ago

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

    • qweqwe14 2 hours ago ago

      No one, it's just a toy language

      • floitsch an hour ago ago

        I think "toy language" isn't really fair. Toit has been developed for 7 years, some of which with multiple engineers working on it full time. (The blog post says 4 years, but that's just for the v2.0.0 development).

        Toit doesn't have a lot of users, but it is used in production (for example by Consibio) and is definitely developed for production environments.

  • Hamuko 3 hours ago ago

    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.

    • ricardobeat 3 hours ago ago

      Good luck running (micro)python on an ESP32.

  • _s_a_m_ 2 hours ago ago

    The last thing this planet needs a new programming language