5 ms·
I feel like a smooth interface between BEAM and Julia would be particularly useful. Elixir would be a nice platform since both have lisp-y macros and 1st class
by dnautics 9y ago
I feel like a smooth interface between BEAM and Julia would be particularly useful. Elixir would be a nice platform since both have lisp-y macros and 1st class AST support, so each language could pass ASTs to each other for execution. Julia could be used for heavy computational loads (which it excels at), and BEAM could handle IO, reliability, supervision, and process management (which it excels at).
An APL on BEAM would probably be terrible; since BEAM intentionally does not support arrays. Having lists all be linked lists is a deliberate choice because you have O(1) immutable copy, which is absolutely critical for passing data between procs without "sharing memory", and creating an absolutely safe concurrent system. Given the relative heavy weight of BEAM, and the featureset it provides, it's quite impressive that for I/O and routing heavy tasks its performance is within an order of magnitude of, say, C.
You could maybe bootstrap arrays as binaries, but as you start making extensive modifications to the array, you will get crazy sharding of the binary information, and performance will die.
- gordonguthrie 9y agoI am writing another post which will describe better the niche I think it should fill - an auxiliary language used to write library modules which would be called from applications written in Elixir or Erlang. The functionality that would be replaced is currently written by traversing lists - this really is a business-rules language add-on to existing infrastructure rather than a high-performance array processing language.
- dnautics 9y agojulia is rolling out an all-julia database solution, and I just wish they used BEAM (probably elixir) as supervisors on top of julia worker processes instead of relying on julia, principally because of the lack of reliability guarantees in julia (I love julia, but it's not really a programming language designed for that)
- geocar 9y ago> since BEAM intentionally does not support arrays. I think tuples count: They're O(1) element access and fixed length. Binaries probably work better for ints though, since a NIF can do heavy work if you solve all the other problems. > Elixir would be a nice platform since both have lisp-y macros and 1st class AST support, so each language could pass ASTs to each other for execution. Julia could be used for heavy computational loads (which it excels at), and BEAM could handle IO, reliability, supervision, and process management (which it excels at). An Unfortunately, neither have what APL has: Good notation.
- dnautics 9y agoTuples don't really count. For performance computing you really want arrays to have mutable contents. Julia's notation is incredibly math-oriented. f(x) = x+1 f(3) #==> 4 M = [2 0 0 2] v = [1,2] M * v #==> [2, 4] v' * v #==> 5 v' * M * v #==> 10 Note some subtleties: m = reshape([1,2],(2,1)) #==> 2x1 matrix m' * m #==> [5] m' * M * m #==> [10]
- geocar 9y ago> Tuples don't really count. For performance computing you really want arrays to have mutable contents. I don't think performance is the biggest win here, but: q/kdb+ doesn't have mutable arrays -- everything is copy-on-write, and it's a lot faster than Julia. If this hypothetical APLish language is otherwise useful, pulling a similar trick would benefit the rest of the Erlang ecosystem. > Julia's notation is incredibly math-oriented. APLs almost universally have better notation though. k/q follows: f:{1+x} /or even just f:1+ // apl is: {1+⍵} M:2 2#2 0 0 2f // apl is 2 2⍴2 0 0 2 v:1 2f M mmu v // k can be M$v; apl is M+.×v v mmu v // v+.×v v mmu M mmu v q is less good with your "subtleties" since it doesn't have rank (unlike other APLish languages), but I'm including it for completeness. m:enlist 2 1f m mmu' m m mmu' M mmu/: m Another APL would probably be better at those.
- dnautics 9y agoHow can you be "a lot faster" than Julia? Julia is regularly 1.2x C and sometimes faster than c when leveraging builtin fortran libraries. What's mmu? Is it matrix multiply? Why isn't it * What is the +.* operator? Can you show me where this operator is described in a non-apl math paper? Im sorry, but when i see apl, I just see a lot of symbols I can't bother to look up to understand. Code reviews would be a nightmare. in Julia, if I were to write a numerical type for galois fields (and I have), I could write compile-time optimized code for performing reed-solomon erasure coding using the builtin matrix operators - the code would be exactly the notation you see in the papers describing erasure coding. You can't do that in apl.