5 ms·
Ask HN: Faster than C, simpler than Python, safer than Rust. Possible?
- gaws 4y ago> faster than C > simpler than Python > safer than rust Meet Nim: https://nim-lang.org/ https://nim-lang.org/
- osrec 4y agoFaster to run or compile?
- owenpalmer 4y agoFaster to run
- tonetheman 4y ago[dead]
- mikewarot 4y agoPascal is as fast as C. It compiles much quicker. It handles pointers in a far safer manner, without the oddities of rust. Plus you can stuff a gigabyte into a string without ever having to allocate anything. Pascal is the language of the future.
- linkdd 4y ago"Faster than C", I saw people write C code slower than a Python equivalent. So I have to admit, I don't know what it means for a language to be fast, because it depends on the algorithm being implemented and the developer who writes the code. --- "simpler than Python", what does "simple" mean? Simple design? Python's design is very complex (take a look at "Crimes with Python's pattern matching" < https://www.hillelwayne.com/post/python-abc/ https://www.hillelwayne.com/post/python-abc/ > for example), on the other hand, assembly languages, or Lisp, or Forth, have a very simple design. Simple as in "easy to use"? Rust is easy, write code, fix what the compiler tells you you did wrong. Joke aside, Go is quite easy to use and while I personally don't like this language, I get why it replaced Python in a lot of use cases. Also, once you get used to the OTP framework, Erlang/Elixir/Gleam/any beam language are quite easy to use and have less footguns than Python. --- "safer than Rust" is too vague. Is it memory safety? type safety? thread safety? cosmic ray safety? A mix of all of that? Let's guess you meant "memory safety". All languages with a Garbage Collector are "memory safe". --- On a semi-unrelated note, I've been working on https://letlang.dev https://letlang.dev It's a language inspired by Erlang/Elixir (same concurrency model) that compiles to Rust code (the runtime use tokio). It is immutable, have no Garbage Collector thanks to Rust semantics, and dynamically typed. I haven't run any benchmark (it's not even finished, I've been working on the specification before continuing the implementation), but I guess it could be slower than a rock. --- For some recommendations, have you looked at Zig? Nim? Hare? https://ziglang.org/ https://ziglang.org/ https://nim-lang.org/ https://nim-lang.org/ https://harelang.org/ https://harelang.org/
- gus_massa 4y ago[Remove the two spaces in the last lines so the links become clicky.]
- linkdd 4y agoDone
- linkdd 4y agoComplementary video supporting my "fast is irrelevant" argument: How slow is JavaScript really? Javascript vs C++ [Data Structures & Optimization] https://www.youtube.com/watch?v=WLwTlC1R2sY https://www.youtube.com/watch?v=WLwTlC1R2sY
- kazinator 4y agoEverything happening in a non-JIT-ted Python program is the action of compiled C code, so if a C program is slower, that just indicates that the C program is going out of its way to waste resources.
- benji-york 4y agoLetlang looks really nice! Keep up the good work!
- karmakaze 4y agoI don't need something faster than C. That only matters on the bleeding edge of AAA games, algo-trading, maybe adtech. None of the areas I choose to work. Also Python is too simple with dynamic types for me.
- aristofun 4y agoTypescript on nodejs for many reallofe backend use cases i observed turned out to be far superior than real world java/scala code.
- Scarbutt 4y agoCan you elaborate on why?
- aristofun 4y agoIt’s simple. To write efficient AND maintainable code in java you have to be both very experienced developer in general and proficient in java. Which most developers are not. So they end up in a pile of piles of crap. While typescript learning curve is negligible and js single threaded nature helps avoiding overengineering mentality. So unless you’re shitty js coder, there’s just less reasons and ways to shoot yourself in the foot.
- aristofun 4y agoTo be fair it’s not applicable to all usecases and situations. If you need to implement next Kafka - there not much you can do with a beautiful nodejs code.
- p1esk 4y agoPytorch
- 082349872349872 4y agoFortran
- MathMonkeyMan 4y agonot far off the mark, especially if you stick to '77
- gridlocdev 4y agoI’m pretty optimistic about V, it so far has great language ergonomics, solid performance, and memory safety through its “autofree” memory feature flag. https://vlang.io/ https://vlang.io/
- Tozen 4y agoV is progressing well, but in beta. It has to maintain its momentum and focus, without getting derailed, and deliver a polished useable 1.0 release. > ...memory safety through its “autofree” memory feature V has different memory management options, which can be turned off and the libraries don't depend on them. GC (default and optional), autofree, arena allocator (prealloc), or manual. This is mentioned in the documentation (https://github.com/vlang/v/blob/master/doc/docs.md https://github.com/vlang/v/blob/master/doc/docs.md). It has numerous safety features, as part of its design, and coupled with the GC (default) or autofree, would provide significant memory safety.
- avinassh 4y agohow does the scoping works? From the homepage: import os text := os.read_file('app.log') or { eprintln('failed to read the file: ${err}') return } lines := text.split_into_lines() for line in lines { if line.starts_with('DEBUG:') { println(line) } } Is lines empty or program exited after the error at `app.log`
- amedvednikov 4y agoIf there's an error at reading app.log, the error is printed, and the function is returned. Code after that won't run at all.
- sally1620 4y agoAda actually trades blows with C in Debian shootout game. It is the language of choice for automotive and aviation safety certification. You cannot get safer than that. and it doesn't have oddities of Rust.
- aborsy 4y agoJulia is about as fast as C (compiled language) and as simple as Python.
- zzo38computer 4y agoMy guess is Ada. I have not used it, but that would be my guess.
- _448 4y agoLooking for https://val-lang.dev https://val-lang.dev ?