News for hackers. Stuff that matters.
Re:Why scientists are turning to Rust by jonniedie on Tuesday December 01, 2020 @08:24PM (#25272244)
A simple data structure:

  struct ASimpleDataStructure
    a
    b
  end
Convert a variable to a different type:

  x = 1
  x = Float64(x)
Open a file:

  open(“a_file.txt”)
Import foreign code:

  using PyCall
  so = pyimport(“scipy.optimize”)
  so.newton(x -> cos(x) - x, 1)
Re:Why scientists are turning to Rust by st1x7 on Wednesday December 02, 2020 @03:19AM (#25274293)
This really isn't constructive.

- I had none of those examples in mind (for example by foreign code I was referring to code written in a different project, not to using a different language). No, I don't need you to give me code snippets on how to do my actual list.

- Obviously Julia can do everything that Python can. And most of it will look ergonomic, short and simple. The difficult part isn't whether the language can do it once you know how, it's how quickly you can get to figuring it out when you don't know it.

- So what makes the small things difficult is really the mix of unhelpful error messages and the limited resources online.

This is my overall point - if you take someone who hasn't written code in either Python or Julia, give them access to online search and ask them to complete almost any task, they'll do it faster and with less effort in Python.

Re:Why scientists are turning to Rust by adamnemecek on Tuesday December 01, 2020 @09:01PM (#25272450)
Yeah defining a strict in python would be more lines.