←back to thread

311 points melodyogonna | 1 comments | | HN request time: 0s | source
Show context
postflopclarity ◴[] No.45138679[source]
Julia could be a great language for ML. It needs more mindshare and developer attention though
replies(4): >>45138887 #>>45138911 #>>45139421 #>>45140214 #
mdaniel ◴[] No.45139421[source]
I don't understand why in the world someone would go from one dynamically typed language to another. Even the kernels example cited below is "eh, the types are whatever you want them to be" https://cuda.juliagpu.org/stable/tutorials/introduction/#Wri...

Then again, I am also open to the fact that I'm jammed up by the production use of dynamically typed languages, and maybe the "for ML" part means "I code in Jupyter notebooks" and thus give no shits about whether person #2 can understand what's happening

replies(1): >>45139719 #
postflopclarity ◴[] No.45139719[source]
It's very important that readers, writers, maintainers, etc. of code are able to easily understand what that code is doing.

explicit and strict types on arguments to functions is one way, but certainly not the only way, nor probably the best way to effect that

replies(1): >>45139888 #
mdaniel ◴[] No.45139888[source]
I would actually be curious to hear your perspective on the "best way" that isn't typechecking. I literally cannot comprehend why someone would write such a thing

I readily admit that I am biased in that I believe that having a computer check that every reference to every relationship does what it promises, all the time

replies(1): >>45140099 #
postflopclarity ◴[] No.45140099[source]
first and foremost great documentation & design docs cannot be surpassed as a tool to explain and understand code. and that is entirely language agnostic.

more generally, the most important bits of a particular function to understand is

* what should it be called with

* what should it return

* what side effects might it have

and the "what" here refers to properties in a general sense. types are a good shortcut to signify certain named collections of properties (e.g., the `Int` type has arithmetic properties). but there are other ways to express traits, preconditions, postconditions, etc. besides types

replies(2): >>45140351 #>>45143339 #
1. const_cast ◴[] No.45143339{3}[source]

  but there are other ways to express traits, preconditions, postconditions, etc. besides types
You can also put that in the type system, and expressive languages do. Its just a compiler limitations when we can't.

I mean, even in C++ with concepts we can do most of that. And C++ doesn't have the most expressive type system.