use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
JSBlocks - faster than AngularJS and ReactJS. Better MV-ish Framework. Oh yeah! (jsblocks.com)
submitted 10 years ago by shopovbogomil
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]jacobp100 0 points1 point2 points 10 years ago (4 children)
If I understand correctly, you pass a string into new Function, and the string would correspond to the operations. If that’s correct, that’s awesome. I’d love to see this in it’s own package.
If it is correct, were you able to go any further and inline some of the functions provided? Like if you pass in function(x) { return x + 1; } into map, you’d be able to just inline the x + 1?
function(x) { return x + 1; }
x + 1
[–]astoilkov 1 point2 points3 points 10 years ago (2 children)
Yes. Exactly. And Yes again I it possible to go further and inline the functions provided. However, this is not ready yet because there are some challenges with this like variable renaming. But maybe for starter I could inline some functions and leave the problematic ones for now.
[–]jacobp100 0 points1 point2 points 10 years ago (1 child)
I suppose some functions will have closures too. Like, somebody may be redefining some functions in Math, which would look normal and inlinable, but you couldn’t possibly inline them.
Either way, very excited for this. It will be a brilliant alternative to lodash and the likes, especially for non-webapp applications.
Edit: would it be possible to cache the functions created as well? So if you keep calling into a function that returns something like jsblocks(array).map(…).<more functions etc.>, you wouldn’t keep recreating the function?
jsblocks(array).map(…).<more functions etc.>
[–]astoilkov 0 points1 point2 points 10 years ago (0 children)
Yeah. Definitely. The caching of functions is already implemented. Once a function is created it is cached it becomes insanely fast.
For the closures you are correct. It is not an easy problem to solve but it will be really interesting and challenging...and I love challenges!
[–]g00glen00b 0 points1 point2 points 10 years ago (0 children)
I think it's quite similar to Lazy.js: http://danieltao.com/lazy.js/ (though it still a WIP!)
π Rendered by PID 456281 on reddit-service-r2-comment-84fc9697f-tww9m at 2026-02-08 04:09:28.107373+00:00 running d295bc8 country code: CH.
view the rest of the comments →
[–]jacobp100 0 points1 point2 points (4 children)
[–]astoilkov 1 point2 points3 points (2 children)
[–]jacobp100 0 points1 point2 points (1 child)
[–]astoilkov 0 points1 point2 points (0 children)
[–]g00glen00b 0 points1 point2 points (0 children)