[–] 4 points 4 months ago (2 children)

Zig is way better than C in many other respects, so if you want a modern sane language and you're either a Rust luddite or working on a project where memory safety isn't that important, it might be attractive.

Like, if the choice is C or Zig, then Zig is pretty much a no-brainer (or it will be when it hits 1.0). It just fixes so many insane things about C that have been broken for literal decades.

  • source
  • parent
  • context
  • [–] 3 points 4 months ago (2 children)

    No Zig definitely is special. You don't have to do any extra busy work to call C code - you can pretty much just #include the header and that's that. It's similar to calling C from C++.

    In any other languages - including Rust - you have to do some work declaring functions, wrapping them and so on. It's not hard but it definitely is a non-zero amount of tedious work (especially before AI). There's absolutely no way you could describe it as "trivial", unless someone else has already done that work for you.

    But I don't think it is a significant Zig advantage really. When I'm writing Rust, it's extremely rare that I want to call any C code that someone else hasn't already done the tedious wrapping for.

  • source
  • parent
  • context
  • [–] 9 points 4 months ago (6 children)

    It's definitely better than C but I'm still unsold on the memory unsafety. Especially after the supposed answer to Bun's memory bugs was "just never dynamically allocate".

    comptime is definitely neat and there are some other nice features but tbh it seems like the only true advantage it has over Rust is compile time, and only for incremental compilation. Is that enough? I would say probably not.

  • source
  • [–] 6 points 4 months ago (4 children)

    GitHub. You're hosting public stuff so there's no more risk of your data being sold on GitHub than anywhere else public. GitHub is what recruiters understand and expect.

    I'll get downvoted by extremists but this is the best option if you want a job and aren't also an extremist.

    I would consider Codeberg or maybe even Tangled for actual projects you're working on, but for just showing stuff of there's no advantage to not using GitHub.

  • source
  • [–] 0 points 4 months ago (1 child)

    Not exactly. It means that any of the code could lead to memory unsafety, but it's still better than Zig or C because you still only have to read 5% of the code to debug/fix those issues, instead of 100%.

    5% is clearly better than 100%. Whatever else you think about this port you can't argue against that. In fact I can prove that it's better.

    1. Does Rust's memory safety design improve memory safety? Yes, this is proven by experience (e.g. see Google's blog posts).

    2. Does "normal" (not slop) Rust code rely on some unsafe? Yes. All Rust code must use some unsafe because it's used in the standard library, and even if you ignore that (there is an effort led by Amazon to formally verify it), it's usual for Rust projects to use at least some unsafe. Let's say 0.1% of lines.

    3. So 0.1% unsafe is clearly better than 100%. Is it possible for 0.1% unsafe to be better than 100%, but somehow 5% isn't? That would require things to be non-monotonic which is completely implausible.

  • source
  • parent
  • context
  • [–] 6 points 4 months ago (1 child)

    He doesn't appear to be using any features of Lisp that made it "the language of (70s) AI". You could do all of this just as easily in many other languages.

    His prof was still wrong.

  • source
  • [–] 3 points 4 months ago

    I can think of a few potential advantages:

    1. Portability: It means you can change your hardware target and you only have to worry about re-certifying this, instead of an entire compiler.

    2. Testing: You can probably run your WASM code fully deterministically in a deterministic simulation much easier than native code. Also when developing you don't need the actual hardware.

    3. Isolation / compartmentalisation. If I were them I would be strongly considering using the WASM component model (in future).

    It would be good if they put their actual motivation in the readme though.

  • source
  • parent
  • context
  • [–] 3 points 4 months ago

    It doesn't mean you made the wrong decision. Changing the names has a potential cost - you break something (this is especially risky for environment variables which have insanely global scope, no static type checking, etc.).

    Not changing the names has a potential cost too - causing confusion in future, wasted time, or even bugs due to the increased chance of mistakes.

    I'm currently leaving a company where they almost never clean up their messes. Tons of old unused code is just left in the repo. Causes huge wastes of time.

    Don't underestimate the potential cost of not keeping things orderly. There was a famous case (Knight Capital) caused by not cleaning up an old unused CLI flag and it cost them $440m and destroyed the company.

  • source
  • view more: ‹ prev next ›