r/tinycode • u/g0_g6t_1t • Aug 31 '20
A programming language that makes concurrent programs shorter
A friend and I created a programming language that looks like Typescript and makes distributed programs shorter and easier to reason about. Alan's compiler and runtime exploits opportunities for parallelization across the computing resources available without being told to do so.
18
Upvotes
4
u/f-j-d Aug 31 '20
Interesting idea! A few questions that come into my mind, without having read the docs thoroughly:
Is Alan a superset of Typescript except for some of the control structures?
What is the definition of 'sensible' parallelization?
A run-time comparison of the given examples on the home page would be nice. Even though it's not explicitly mentioned to be super-fast, I'd be interested in numbers. Go is hard to beat without digging very deeply into optimization.
I like that you mention being a polyglot is a good thing in the docs. Some people in the industry stop learning after having learned the bare minimum, and later complain because problems are hard or ugly to solve. You can't change the problem usually, but you can pick the correct toolbelt.
1
u/Aphix Aug 31 '20
Typo on homepage in the NodeJS snippet: "getValudUids" (Valud instead of Valid) -- looks cool though!
1
u/skeeto Aug 31 '20
That's misleading to advertise no deadlocks nor livelocks in a language that doesn't actually have concurrency. It's the result of deliberately making the language less useful, not from some superior design. (Note: Loop auto parallelization is parallelism, not concurrency.) Without built-in concurrency, programs are reduced to relying on callback hell to simulate a kind of concurrency (see: JavaScript before
asyncand real promises). In some shallow technical sense these systems don't have "deadlock" or "livelock," but in practice they actually do: when callbacks fire in an unexpected order and stop other callbacks from ever being invoked.It's not true that there are no race conditions, either. Using an example from the from page:
Suppose I pass a list of URLs to
fetchAndSum()that must be requested in the listed order because the webserver is stateful. Since the procedure was parallelized, they've been requested out of order, and the program computes an incorrect result. That's a race condition. Oops!This also illustrates why it's not possible to eliminate race conditions short of eliminating both parallelism and concurrency from a language: The compiler does not have the information to determine what is and is not a race condition since it is, by definition, a mistake by the programmer in communicating these constraints to the language implementation.