Rust   16275

« earlier    

The Observation Deck » Falling in love with Rust
I really liked the section on error handling. He provides context on many different ways to do error handling, and why a Result type is so useful and powerful.

Platforms reflect their values, and I daresay the propagation operator is an embodiment of Rust’s: balancing elegance and expressiveness with robustness and performance. This balance is reflected in a mantra that one hears frequently in the Rust community: “we can have nice things.” Which is to say: while historically some of these values were in tension (i.e., making software more expressive might implicitly be making it less robust or more poorly performing), through innovation Rust is finding solutions that don’t compromise one of these values for the sake of the other.

This is true on so many levels...

When I was first learning C, I was (rightly) warned against using the C preprocessor. But like many of the things that we are cautioned about in our youth, this warning was one that the wise give to the enthusiastic to prevent injury; the truth is far more subtle.
rust  programming  BryanCantrill 
yesterday by jefframnani
The Observation Deck » Falling in love with Rust
I'm learning Rust, and like Cantrill I appreciate how Rust incorporates older good ideas in a consistent way. For comparison, here's his list of likes measured against Scheme, a language I feel comfortable with. (I chose Racket because it's actively developed, well thought out, and has a large library. Other modern Schemes like Guile would be about the same.)

Error handling: Racket has ADTs and pattern matching, but the APIs all raise exceptions. The propagation operator could be a macro, but I don't think they have it in the default library, for the same reason. (Does Racket have any semipredicates that aren't taken from standard Scheme? It seems like something they'd want to avoid.)

Macros: Racket is famous for "macros that work together". But there's nothing like format! or the Debug trait, again for historical reasons. It also seems to me that the macros don't work together as well as you'd like: given N related kinds of functionality, you often have N^2 macros implementing the cross-product of them all. Compare Rust's for loop and std::iter::Iterator with Racket's for, for/list, for/vector, for/hash, for/hasheq, for/hasheqv, etc. etc.

include_str!: Racket gets half a point for include/reader. No raw strings.

serde: racket/serialize only works with readable values (what are serde's limitations?). Nothing like serde_json::from_str; roll your own.

tuples: Again, the pieces are there (define-values, match, etc.), but the APIs don't really use them like this.

integrated testing: Racket has (module+ test ...).

performance: Racket is pretty good, but Chez is still the one to beat.

To sum up, Racket (and Scheme in general) has good primitives, but it's weighed down by old APIs.
programming  rust 
yesterday by daniel.c.mccarthy

« earlier    

related tags

9p  ad  adhoc  advantages  algorithms  alternative  api  architecture  argument  article  authentication  awesome  bcantrill  bestpractices  bitwarden  blog  briancantrill  bryancantrill  c#  c++  catherinewest  cli  closures  code  comma  commas  comparison  criticisms  csv  data  database  dev  double  ebook  ecs  embedded  emulator  entity-component-systems  example  fast  float  fp  framework  game-dev  game-development  game  gamedev  games  github  go  golang  grep  gui  hn  hoc  http  ide  ieee754  ifttt  important  impression  in  index  inspiration  interesting  isucon  java  javascript  jq  kernels  language  learning  library  mathematics  mentat  minimalism  nim  node  nodejs  opensource  performance  philosophy  pinvoke  plt  profiler  profiling  prog  programming-language  programming  puzzle  py03  python  quick  reference  repo:github  ripgrep  rust-lang  rust  sample  search  serialization  shell  simplicity  slice  software  statistics  stats  sudoku  tech  theme  theory  this  thoughtworks  threading  tool  toolkit  tools  toread  tutorial  type  unix  unsafe  value  values  video  wasm  webassembly  webrender  week 

Copy this bookmark: