Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
ddragon
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
11 ms
·
31.
▲
by
ddragon
6y ago
It's a form of function overloading, but works on runtime types. for example let's say we have a Dog and Cat, both subclass of Animal. And you define f(Cat, Dog), f(Animal, Animal). In languages without multiple dispatch, if you c
32.
▲
by
ddragon
6y ago
About your last point, you shouldn't conflate popularity with being better. There are languages with heavy focus on education (both in the language itself and tooling) like Racket that are still not heavily used compared to python even
33.
▲
by
ddragon
6y ago
To be fair you wouldn't just expose your server directly nowadays, you'd have them in a container orchestrator like k8s that would have a liveness probe (and container usage tracking) that would appropriately scale/restart po
34.
▲
by
ddragon
6y ago
As the name implies, single dispatch is just a special case of multiple dispatch. Everything that can be done with single dispatch works exactly the same (arg1.f(arg2...) is just f(arg1, arg2...) in Julia), so there is no loss in expressivi
35.
▲
by
ddragon
6y ago
You can pick both, they are very different. Julia is a dynamic language looking for a compromise between interactivity and performance (from it's origin on R/Matlab), while Nim is one of the new batch of static languages that look
36.
▲
by
ddragon
6y ago
Yes, I ended up writing as if they were different when it's a direct translation, except that quote transforms the visible syntax into a different hidden syntax, which is what makes it non homoiconic.
37.
▲
by
ddragon
6y ago
Non homoiconic languages (Elixir, Julia) usually use quote/unquote syntax, with quote being a construct that transforms code to AST and unquote evaluates an AST. For example in elixir: a = 3 quote do if unquote(a) > 3 do
38.
▲
by
ddragon
6y ago
I honestly love macros, so I would probably use that feature much more frequently than decorators (if it's even approved, I would expect a lot of macro requests for Python over it's history), but this seems like something that sho
39.
▲
by
ddragon
6y ago
Julia has multi-stage compilation: first it's lowered to the AST (all macros are resolved), then it is lowered to an IR, then types are solved, then it's lowered to an SSA form IR, then to LLVM IR and finally machine code [1] (and
40.
▲
by
ddragon
6y ago
While I hope they'll keep the pace of improving the JIT lag (perhaps even adding a fast optional interpreter or AoT compilation of parts of code), the benchmarks are fine considering compilation is a one time paid ticket, while runtime
41.
▲
by
ddragon
6y ago
I'll have to disagree with your defeatist generalization here: creating something with better knowledge of the problem and a lot of hindsight will not necessarily get as complicated for the same feature set. In fact the resets are prob
42.
▲
by
ddragon
6y ago
Not sure what you mean about being a turn-off to engineers. I'm an electronic engineer currently working on production data engineering pipelines (which has no relation to the engineering in my degree) and I quite like the language. 1-
43.
▲
by
ddragon
6y ago
I feel like you considering Python as having few real pain points in data science as either lack of knowledge of other languages or imagination/ambition. I do work on Python for data science/engineering in a production environment
44.
▲
by
ddragon
6y ago
By that logic people should have kept using Fortran instead of Python (which was the new guy a couple decades ago). But Fortran will never be Python, and Python will never be Fortran, no matter how much maturity/improvements. Because m
45.
▲
by
ddragon
6y ago
>I don't really remember if zero-indexing was a big deal when I was learning to program And neither is 1-indexing even though people are always complaining about it. I kinda like when indexing from the third element to the seventh e
46.
▲
by
ddragon
6y ago
Julia makes it easier for example with functions that handle mod in the context of 1-indexed arrays (if you don't want to use OffsetArrays). https://docs.julialang.org/en/v1/base/math/#Base.mod1
47.
▲
by
ddragon
6y ago
Julia's main parallel primitive (@spawnat) [1] is heavily inspired in Go, in which you just run anything in a managed lightweight thread, using a channel to pass data and sync with a fetch. That API is quite recent though (Julia 1.3),
48.
▲
by
ddragon
6y ago
You still get an API that encapsulates the behavior. This is not like monkey-patching (directly changing the behavior of libraries), but separating the abstraction layers. Every complex enough system will have multiple layers (for example w
49.
▲
by
ddragon
6y ago
Having a language that hides it's lispness behind a python-like syntax can be good for the lisp community though, even if they don't use them. People do have prejudice against those parenthesis, so having an entry point that is &q
50.
▲
by
ddragon
6y ago
Python is a high bar to beat though, since no one understands beating Python as beating some hypothetical Python-only numerical library, it's beating mature precompiled C/C++/Fortran libraries with a small overhead in Python.
51.
▲
by
ddragon
6y ago
I can't say anything about smalltalk since I only played with the VM once and don't know the whole story, but I can think of two reasons why Lisp even though they are more dynamic than Python (for some definition of dynamic) it&#x
52.
▲
by
ddragon
6y ago
This reminds me of these slides on the Julia compiler and Zygote [1] that really impressed me at the time. Not only the compiler is incredibly smart, it also gives the programmer to a lot of tools to talk with it (the introspection macros,
53.
▲
by
ddragon
6y ago
That was just around 2 years after the language became public and 4 years before it became stable, so I wouldn't really call the language "mature" back then (I didn't use the language then to have the insight even if I g
54.
▲
by
ddragon
6y ago
Sorry, you're right in that Julia is written in C/C++, so everything Julia does can be solved in those by writing a language (like Julia itself, and not unlike Tensorflow original interface) and compiling it on demand and finding
55.
▲
by
ddragon
6y ago
Sure, if you give static language a JIT they'll be able to get the advantages of having JIT, though language semantics still matter. A language built for JITs like Julia or Common Lisp have native ways of interfacing with the compiler,
56.
▲
by
ddragon
6y ago
He probably means Tullio.jl (which also seems to integrate with Julia's source to source differentiation library Zygote.jl, the main competitor to Swift for Tensorflow): https://discourse.julialang.org/t/realistica
57.
▲
by
ddragon
6y ago
The unique property is the ability to just pick any code or library that is unaware of the differentiation library (unlike tf.function as it needs to specifically use tf methods) and get the gradient. In a language like Julia this is immedi
58.
▲
by
ddragon
6y ago
I answered above on a general sense, but this course is Introduction to Computational Thinking. First it's an introduction course, so it's not required experience with any language (you have lessons explaining arrays for example).
59.
▲
by
ddragon
6y ago
It's not really a random choice in this case, Julia was created on MIT, and this is an MIT course. It's also free and open-source unlike it's competitor Matlab. It's also a very appropriated language for the theme consid
60.
▲
by
ddragon
6y ago
Regardless of future mainstream appeal, I don't think Julia will meet the same fate as Lua in the area simply because of how simple it is to create and maintain DL libraries compared to Python. Multiple dispatch, native matrix support
More ›