
Pogoscript – a compile-to-JS language that emphasises concurrency, readability - networked
http://pogoscript.org/
======
acjohnson55
I 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...](http://masnun.com/2015/11/11/using-es7-asyncawait-today-with-
babel.html)

[4] [http://blog.paralleluniverse.co/2015/08/07/scoped-
continuati...](http://blog.paralleluniverse.co/2015/08/07/scoped-
continuations/)

------
djfm
> 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)

------
sriku
Shameless 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.

------
pault
Very interesting! Can you tell us a little bit more about how you wrote the
transpiler?

------
Etheryte
Great, another non-standard and obscure way to write Javascript.

~~~
moron4hire
Nobody is forcing you to use it.

~~~
RussianCow
Until your boss or client thinks it's a good idea. :)

~~~
moron4hire
You 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
What 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.

------
simple10
Pogoscript -> JavaScript examples

[http://www.featurist.co.uk/pogo-examples/](http://www.featurist.co.uk/pogo-
examples/)

------
millstone
I 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?

------
moron4hire
This 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
Concurrency 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
Talk by Rob Pike explaining the difference:
[http://youtu.be/cN_DpYBzKso](http://youtu.be/cN_DpYBzKso)

