TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Functional javascript in one page

60 pointsby alifazizabout 13 years ago

4 comments

josteinkabout 13 years ago
This works, but it still looks dirty, mostly due to javascript's lack of concise lambda-syntax.<p>If you want to use a functional language, it would seem more fitting to create an actual functional language with actual list comprehension, something javascript is ridiculously weak at, and so on.<p>Ofcourse that would then have to be compiled into something which runs in the browser. Another argument for web-bytecode I guess.<p>Edit: To not just throw hot air around, I tried doing something similar (with typing on top!) during a weekend long long ago. I wasn't happy about the result, but I left the code online.<p>For those curious about my take on the same problem: <a href="http://code.kjonigsen.net/js/spicejs/test.html" rel="nofollow">http://code.kjonigsen.net/js/spicejs/test.html</a><p>You'll have to view the source to see how it works, and open the web-developer console to see the output.
评论 #3649832 未加载
tikhonjabout 13 years ago
"In one page" is pretty meaningless if you make the page arbitrarily long :P<p>That said, it's a nice reference for a nice library.
Detrusabout 13 years ago
I think this is one of the inspirations for underscore.js
mericabout 13 years ago
Seems awesome. I wonder if there is performance penalty for compiling the string partial functions though. e.g. '&#62;2'.
评论 #3647561 未加载