3 pointsby arisim8 hours ago1 comment
  • Panzerschrek7 hours ago
    Is it safe? Or it is just yet another C replacement with footguns placed everywhere?
    • arisim6 hours ago
      It’s as safe as I could make it. It uses ARC under the hood and I have a bunch of warning systems and whatnot to prevent people from doing stupid things. It’s still a fairly low level language so if you really want to do dumb things you still can tho. But I also run my entire Tin test suite through valgrind on a regular basis and not seeing any issues memory management wise :)
      • Panzerschrek6 hours ago
        How well does it prevent doing stupid things? Can one cause use-after-free errors? Can one read/write memory out of bounds? Can one create a race condition? Does it all require using some sort of separate "unsafe" subset of the language, or doing so is possible in regular code?
        • arisim5 hours ago
          You can cause use after free if you manually allocate memory (which isn’t required at all because my ARC implementation manages memory for you and I implemented compile time heap promotion). Out of bounds reads and writes are caught by the compiler in best effort (ofc I can’t detect out of bounds errors if you offset a `*void` by an arbitrary number that was alloced with `mem::malloc` _somewhere_ but I do my best to catch common pitfalls). You can create a race condition but I tried to make the languages as much of a batteries included language as possible, so the stdlib provides primitives to avoid data races. There is no unsafe subset, if you want to do stupid stuff, the language allows you to do so (within reason) :D