3 ms·
Interesting how they now reverted back from a Scheme-like language, previously also published by Goodman at https://probmods.org/ https://probmods.org/ Do you
by avaku 12y ago
Interesting how they now reverted back from a Scheme-like language, previously also published by Goodman at https://probmods.org/ https://probmods.org/
Do you think it's because of all the parentheses that people can't understand?
- BenoitEssiambre 12y agoThey use a mostly functional subset of javascript (You are not allowed loops). It is much more readable than scheme if you ask me but not necessarily more powerful. You get the benefits of the very powerful and ubiquitous javascript compilers that exist nowadays which I like. I played with it and you are somewhat limited right now. The first issues is that you quickly hit the top of the javascript stack because of the recursive style (remember: no loops). The most elegant solution to that would be for browsers to support tail call optimisations which is in the ES6 standard (Are you listening Mozilla or Google? If you implement this part of the spec sooner you could be leading the way for the most promising area of AI and maybe of computing in general). Although there are possible work around namely if the webppl compiler were to use trampolines or "promise" like structures. IMO, it would clutter the code and be much less elegant than native ES6 TCO. The second limitation is that you are not allowed mutability. There is a git branch with support for mutability partly implemented. I'm not sure they should go that way though. I've never really been into functional programming style but in the case of probabilistic languages, I really see the value. It's much simpler and easier to follow what is going on when debugging. Supporting mutability also makes the compiler more complex and memory usage high as you have to copy the whole memory footprint of your program at each probabilistic sample you take. It is not that difficult to instead include something like mori http://swannodette.github.io/mori/ http://swannodette.github.io/mori/ to manipulate arrays immutably.