4 ms·
Solving the expression problem requires maintaining static type safety. AFAIK Julia doesn’t do this because it’s dynamically typed.
by pansa2 6y ago
Solving the expression problem requires maintaining static type safety. AFAIK Julia doesn’t do this because it’s dynamically typed.
- shele 6y agoPeople using Julia are quite happy how it alleviates the expression problem compared to languages they used before. Your argument, if I get it right, that Julia can't solve the expression problem because "the expression problem requires maintaining static type safety" reminds of the "Bumblebees can't fly" fable.
- Hitton 6y agoMost people using language X are quite happy how X does things compared to languages they used before. That's why they use the language X. That's also the reason why I consider this type of argument unhelpful.
- shele 6y agoNo, not "most people" and not "happy how X does things" but specifically people who have thought about the expression problem's opinion about how Julia alleviates the expression problem compared to other languages they know.
- saithound 6y agoWell, the expression problem is a clearly formulated question: how can we have three desirable things at the same time (no need to modify existing code, no need for code repetition and no need for runtime type errors [1])? See also the project management triangle: if you need something fast, good and cheap, then fast, good and expensive won't be a satisfactory answer, no matter how many millionaires are satisfied with the latter. [1] https://link.springer.com/chapter/10.1007/978-3-540-24851-4_6 https://link.springer.com/chapter/10.1007/978-3-540-24851-4_...
- shele 6y agoHonestly, if you want to discuss the progress made on the expression problem by a dynamical language whose power and extensibility partly comes from a collection of informal, consensus based interfaces you have to start from a different theory.
- mirekrusin 6y agoI don't think you can classify Julia like this. It's kind of both. Julia has types on bindings, in that sense it is statically typed.
- pansa2 6y ago“Julia is squarely in the dynamic camp” - Stefan Karpinski, Julia co-creator https://stackoverflow.com/a/28096079 https://stackoverflow.com/a/28096079
- codr7 6y agoWell, that's like...his perspective. It's a spectrum, not either or. Julia and Common Lisp are somewhere in the middle.
- mirekrusin 6y ago...but you've ommited what I meant "(...) Unlike many dynamic languages, however, Julia has a fairly sophisticated language for talking about types, and you can annotate expressions with types. (...)" Also other answers have some good information, ie: " (...) It can also be useful to indicate the argument types to restrict the kind of parameters passed when calling. Our function header for floating point numbers would then look as function mult(x::Float64, y::Float64). When we call this function with mult(5, 6), we receive an error, ERROR: 'mult' has no method matching mult(::Int64, ::Int64 ), proving that Julia is indeed a strongly typed language. It does not accept integer parameters for the floating point arguments. (...) " ...in other words saying that "Julia is dynamic langauge, full stop." doesn't answer the question fully as for many readers it implies "weak typing", however it's dynamic, but strongly-typed, with state of art optimisations available as in statically typed languages, with proper multiple dispatch on all arguments (not single/this dispatch as in ie. java) etc. It is definatelly worth playing with the language for people who hesiate on learning it - Julia provides some very interesting features not seen anywhere else.