7 ms·
I've found Julia to be an excellent language for Project Euler [1]. Besides the speed, you can use Unicode identifiers, so the solution can closer follow the ma
by queuebert 4y ago
I've found Julia to be an excellent language for Project Euler [1]. Besides the speed, you can use Unicode identifiers, so the solution can closer follow the math.
1. https://projecteuler.net/ https://projecteuler.net/
- recursive 4y agoThat doesn't seem to be a particularly distinguishing feature. I know that C#, python, and javascript can all use non-ascii identifiers. I believe most widely used languages can also, but I'm less certain of the details.
- martinsmit 4y agoThe difference is that Julia makes it easy to insert these characters (\symbol) so programming with them becomes more natural.
- jb1991 4y agoThere’s also Swift, of course. https://docs.swift.org/swift-book/documentation/the-swift-programming-language/stringsandcharacters#Unicode https://docs.swift.org/swift-book/documentation/the-swift-pr...
- adgjlsfhk1 4y agoI think the distinction is that Julia's parser does a relatively good job assigning code-points to unary operators/binary operators/identifiers as appropriate, combined with the fact that multiple dispatch inherently looks more like math.
- npalli 4y agoJulia will read 2π (fixed:thx kps) as 2 times pi which follows the mathematical notation. In all the other languages you have mentioned, I believe even if you can represent pi in Unicode (π) you will have to write 2*π. This can become very irritating when you get to for ex. python/numpy where you will litter your code with * and ** instead of the conventional mathematical notation. Gets a bit tiring if you are looking at more than a page of code. Aesthetics matter.
- deleted 4y ago[deleted]
- oefrha 4y agoIf you really care about mathematical notations, you should be using Mathematica, not Julia.
- adgjlsfhk1 4y agoMathematica is definitely better than Julia for symbolic math, but for computational math or algorithm development, Matlab is basically unusable.
- galangalalgol 4y agoI find that really surprising, would you elaborate? I love julia but I haven't found a repl or pluto based workflow that I am anywhere near as productive in for prototyping algorithms as I am in Matlab. And it typically doesn't even run that much slower.
- adgjlsfhk1 4y agotypo, sorry. that Matlab was supposed to be Mathematica. IMO Julia is also better than Matlab here (I use editor+repl, but Pluto is also pretty good), but Matlab is definitely a contender in this area.
- galangalalgol 4y agoEditor from within the repl or outside? If outside, what triggers the repl to reload files? If inside, which editor? I never found a good way to copy and paste a line I got right and liked into a file. I tried drdocstrings but it never seemed to feel smooth bit doesn't help all the keys in julia default to being emacslike and ally muscle memory is vimish. So even after making my repl editor vim, there is stuff in the repl that feels foreign.
- moelf 4y agothe Julia REPL allows you to type unicode with \blah, also if you use `?` help mode, you can give it a unicode sequence and it will tell you how to type it, so it's nice quality of life help?> Ψ₂ˣ "Ψ₂ˣ" can be typed by \Psi<tab>\_2<tab>\^x<tab>
- andyferris 4y agoWhile true, one distinguishing features is the sheer number of unicode binary and unary operators that can be used and overloaded. Take for example ∪ for set union and ∩ for set intersection (eg `set1 ∪ set2`). (You can also type these easily via latex-style completions, e.g. with \cup<TAB> for ∪ or \cap<TAB> for ∩)