Friday, August 24, 2018

Rust, week 2...

The continued, albeit slow, adventures of someone who's been coding for 37 years and is now learning Rust...

Things I like about Rust, pt2...
  • std::option::Option - no more Null... force error check at point of creation
  • Inbuilt testing framework
  • RustFmt - code formatting !
  • Everything is on Github... and I mean everything... fantastic !
  • Safety is not sacrificed for simplicity. Yes, Rust is a complex language, but that's because decisions have been made which puts safety and control first rather than convenience.
  • The team provide editor integration plugins... including the mighty VIM !
Things I don't like about Rust
  • Opening curly brackets on the right... argh ! I know it's just convention, but argh ! 
There's something quite exciting about the Rust community... the deeper I delve into the language and how the project is organised the more excited I get. One major problem with older languages like C and C++ is that the ecosystem around how you develop software in those languages is a bit of a free-or-all. How may build systems are there out there for C++ projects ??? Loads... Code formatters ?... loads. Library managers...loads...etc. The C++ language itself may be well specified but the ecosystem in which it lives is all over the place. Modern language designers are not making this mistake.

Rust comes with a suite of tools to standardise the ecosystem of the Rust language... and this is a good thing. Go does the same. Having standard ecosystem makes the heavy lifting around learning a language much easier. If you want to buid a Rust project you plop yourself into the root of the project and type 'cargo build'... that's it. You're not mucking about with configs, makefiles, cmake or any other custom build system. This gets a thumbs up from me.

Anyway, more next week as I get further through The Book and keep prodding around in rustlang.

Saturday, August 18, 2018

Rust, week 1.

I've started looking at Rust again. I had a quick try of rust about 18 months ago when I was looking at modern alternatives to C++. At that time I learned a bit of Rust and also some Go. Both languages impressed me but to be honest I liked the feel of Go more... mainly because it was simpler to learn.

Time has passed and my mind has wondered back to Rust. This page is a scrap book of thoughts about Rust during my first week back.

Things I like about Rust...

  • Built-in a build system (cargo)
  • Immutable by default
  • Explicit data ownership semantics
  • Built-in documentation about the language and compiler errors
  • Sensible type inference
  • External module dependency versioning makes sense
  • No implicit bool conversion
  • Descriptive error reporting
  • Tuples !

Things I'm not sure about... note I'm not saying these things are bad... just that I'm unconvinced at this point
  • Allowing variable type changes via shadowing
Progress reading 'The Rust Book' - 6.1 Defining an enum.

Documentation is good and the community seem pretty tight and to know what they are doing. I've also watched a fair few Rust talks on YouTube now, which are easy to find. So go watch them !

More next week.

Backplate Musings

My original plan for the LINK_01... my first homebrew computer... was to ultimately have it built using a single PCB. But the more I think a...