472 karma · joined Sep 17, 2014 (12y ago) · 223 submissions
comment 9y ago · link · parent
Also, you make it sound like disabling automatic updates is something that requires work, hence needs to be prioritized on a task board. In fact it is quite the opposite: work was needed to enable automatic updates in the first place!
comment 9y ago · link · parent
comment 9y ago · link · parent
The reason this snippet is complex is that:
1. It deals with the Foreign Function Interface
2. It deals with the FFI with respect to C++, which is much more complex than the one towards C, essentially because C++ itself is complex
3. It uses a particular construct (emit) that is only needed when the standard FFI is not enough
So the example is really a showcase of a particularly complex case that you will likely not encounter, unless you start wrapping C++ libraries (which is not an easy task, unlike the C ones)
comment 9y ago · link · parent
It can easily be wrapped in a more usable API, for instance I have made mine: https://github.com/andreaferretti/rosencrantz
comment 10y ago · link · parent
And still, I find that most of the abstractions that appear, say, in Haskell have little mathematical content. Even less so their imitation in Javascript. ¯\_(ツ)_/¯
comment 10y ago · link · parent
As for being functional, strictly speaking it is not, but still has some features like closures and higher order functions, immutable variables, the usual suspects (map, filter, ...) can be inlined with zero overhead, side effect tracking and so on (in addition to a very good macro system)
comment 10y ago · link · parent
comment 10y ago · link · parent
comment 10y ago · link · parent
Also, I am not sure what you mean by "first class SIMD structures", but you can definitely have a single definition for sin4f and sin8f if they are line by line equal except types, by using union types.
comment 10y ago · link · parent
For the animations, it is often just a matter of continuosly updating the state of some component, something that I did in this mixin https://github.com/andreaferretti/paths-js-react-demo/blob/m...
comment 10y ago · link · parent
If you have any proof of concept of how it might work, I would be glad to get a PR! :-) Ideally, it would be something that can be layered on top of the existing core, so that one could import "syntax helpers" from a separate module
comment 10y ago · link · parent
The problem with the syntax you propose is that it does not compose well.
For instance, in the example you give, `path`, `get` and `ok` are all handlers, but they appear in very different roles syntax-wise. It is not clear to me how one would add one more level, say to parse handlers.
I agree that the [] syntax is not the best-looking in the world, but I need something where I can do the equivalent of `h1[h2]`, where `h1` and `h2` are both handlers.
Templates and blocks would sort of work, but not in the case where both `h1` and `h2` are, say, stored in a variable. I am all for trying to obtain a better syntax, but I would not like to lose composability for that
comment 10y ago · link · parent
The problem is that they need to be given the AST. What if one constructs a handler somewhere in another module (say an authentication handler) and you import it? How can you reuse it, considering that it needs to surround other handlers (that is, if auth fails, you do not go inside inner handlers)?
With Rosencrantz it is easy: if `auth` is our authentication handler, and in your module you define a handler `h`, you can use `auth -> h`, or `auth[h]` if you want to spell `h` inline.
Now, what you could in fact do is write a template `authTemplate` that takes a handler `h` and returns `auth -> h`, so that you can still write in template style. But you have to do this for all handlers.
It could make sense to provide such templates for builtin handlers, though... want to chime in? :-)
comment 10y ago · link · parent
Jester, like many other frameworks, hardcodes exactly what to do with a Request - say parsing the headers, parsing the form if the content type suggests so, always return a date, and so on.
This is not bad per se, but I prefer to have something I can compose. Say, I have a working route `r`. If I want to add CORS support, for instance, I can just make a handler `h` that adds CORS headers and then use the route `h -> r`.
This is more flexible and leaves fine grained control over which headers to require, or return, how to do content negotiation, and so on. You can separate your routes for `POST` from those for `GET` in different modules and then combine them, or maybe separate your authentication routes from the business logic ones. You can easily create handlers that work as middleware, and so on.
In short, the thing I like about this approach is that handlers become first class objects that you can manipulate and create freely
comment 10y ago · link · parent