6 ms·
Pogoscript – a compile-to-JS language that emphasises concurrency, readability
- pault 11y agoVery interesting! Can you tell us a little bit more about how you wrote the transpiler?
- djfm 11y ago> But async IO was seriously complicated. I mean, complicated in a way that made you think, which is not usually a bad thing, but eventually you just want to get stuff done. [1] Couldn't agree more, very interesting solution you've come up with! [1] http://pogoscript.org/2012/12/05/async.html http://pogoscript.org/2012/12/05/async.html
- Etheryte 11y agoGreat, another non-standard and obscure way to write Javascript.
- moron4hire 11y agoNobody is forcing you to use it.
- RussianCow 11y agoUntil your boss or client thinks it's a good idea. :)
- moron4hire 11y agoYou have only one job, and that's to do what the client wants. It doesn't matter what language that is in. And you're free to leave whenever you want.
- Dr_tldr 11y agoWhat is the weather like on the Planet of the Obscure Language Clients? Is there any way I can book passage there? Why, if I had a nickel every time I was forced to turn down a client who demanded the project be done in Clojure, Scheme, Haskell, Pogoscript, or Brainfuck... I would have zero cents.
- madeofpalk 11y agoThen you've got a shitty boss or client if they're forcing this completely unknown and unsupported language on you.
- Etheryte 11y agoI think you addressed the point I wanted to make better than I could myself with the words "unknown" and "unsupported".
- moron4hire 11y agoCome on. Every project has to start somewhere.
- madeofpalk 11y agoTrue. I have no opinion on this project, apart from being impressed by someone making their own x-compile-to-JS language. But a boss shouldn't _force_ something this immature onto their devs.
- simple10 11y agoYes, but all these JavaScript transpilers ultimately make for a healthy ecosystem. Arguably, we'd all be using the Erlang VM instead of Node if the Erlang community had more than just Elixir as a transpiled launguage. But it is a challenge for the JS community to sort through the tools explosion of the past 2 years.
- deleted 11y ago[deleted]
- moron4hire 11y agoThis is pretty cool, but nitpick: asynchronicity != concurrency. Workers are the only way to do concurrency in JavaScript at this time, and none of the example code is demonstrating anything involving Workers.
- Arnavion 11y agoConcurrency is the property that two or more tasks may be interleaved, instead of requiring one task to complete before another begins. Thus async I/O would only be distinguishable from sync I/O if there were concurrency, i.e., another task can run while the first task is waiting for the completion of that async I/O. What you're talking about is parallelism, which is the property that more than one task may execute at the same time. That is what Web Workers achieve.
- notduncansmith 11y agoTalk by Rob Pike explaining the difference: http://youtu.be/cN_DpYBzKso http://youtu.be/cN_DpYBzKso
- simple10 11y agoPogoscript -> JavaScript examples http://www.featurist.co.uk/pogo-examples/ http://www.featurist.co.uk/pogo-examples/
- acjohnson55 11y agoI very much like this model, but I wonder how necessary it is when we have IcedCoffeescript [1], ES6 generators + co [2], and ES7 async/await [3] as viable ways of managing async control flow within mostly synchronous-looking code, all as dialects of languages that have strong adoption. I actually think generators + co is a really strong model. Async/await gives you a slight bit of sugar, but I've realized that if you stick with generators, you can wrap your generators to allow you to `yield` more than just promises, effectively giving you something like (untyped) scoped continuations [4]. [1] https://maxtaco.github.io/coffee-script/ https://maxtaco.github.io/coffee-script/ [2] https://github.com/tj/co https://github.com/tj/co [3] http://masnun.com/2015/11/11/using-es7-asyncawait-today-with-babel.html http://masnun.com/2015/11/11/using-es7-asyncawait-today-with... [4] http://blog.paralleluniverse.co/2015/08/07/scoped-continuations/ http://blog.paralleluniverse.co/2015/08/07/scoped-continuati...
- millstone 11y agoI can't get the concurrent stat example from http://pogoscript.org/2012/12/05/async.html http://pogoscript.org/2012/12/05/async.html to work. It doesn't do anything when run. I think it's exiting at the first async call. My shell session: http://codepad.org/xWoOrHpe http://codepad.org/xWoOrHpe How do I fix this?
- sriku 11y agoShameless plug - CSPJS - a sweetjs macro that supports a similar async mechanism and (imho) better error handling facilities. https://github.com/srikumarks/cspjs https://github.com/srikumarks/cspjs Have been using it in a production system for a year now.