J

James Long

jlongster.com · Personal blog · on HN since 2009

James Long, a programmer, writes about JavaScript, React, async patterns, compilers and SQL in the browser.

What HN saysCommenters say he and a few others stay ahead of the industry, and they recommend his React and generators posts for learning concepts.
118HN people shared it
66linked it in comments
139stories submitted
9.6Kstory points
2 years agolast shared
2009people per year2026

Most-shared posts

  1. 1
  2. 2
    A future for SQL on the web
    15 people · 1.0K points · first shared 2021 · 218 comments on HN
  3. 3
  4. 4
    Taming the Asynchronous Beast with CSP in JavaScript
    6 people · 147 points · first shared 2014 · 29 comments on HN
  5. 5
    Writing apps for the iPhone in Scheme
    6 people · 101 points · first shared 2009 · 14 comments on HN
  6. 6
    Stop Writing JavaScript Compilers, Make Macros Instead
    5 people · 364 points · first shared 2014 · 145 comments on HN
  7. 7
    What’s in a Continuation (2016)
    5 people · 169 points · first shared 2016 · 51 comments on HN
  8. 8
    A Study on Solving Callbacks with JavaScript Generators
    5 people · 100 points · first shared 2013 · 8 comments on HN
  9. 9
    Why does the chromaticity diagram look like that?
    4 people · 293 points · first shared 2024 · 84 comments on HN
  10. 10
    Compiling LLJS to asm.js
    4 people · 105 points · first shared 2013 · 34 comments on HN
  11. 11
    Back End Apps with Webpack: Part I
    4 people · 67 points · first shared 2015 · 34 comments on HN
  12. 12
    Statements about the Mobile Web
    3 people · 273 points · first shared 2015 · 174 comments on HN
  13. 13
    Immutable Data Structures and JavaScript
    3 people · 195 points · first shared 2015 · 70 comments on HN
  14. 14
    Lisp: It's Not About Macros, It's About Read
    3 people · 158 points · first shared 2012 · 99 comments on HN
  15. 15
    Lisp: it's not about macros, it's about READ (2012)
    3 people · 157 points · first shared 2016 · 99 comments on HN

What HN people wrote when they linked it

Davertron · 2017-01-30
David Nolen - http://swannodette.github.io/ James Long - http://jlongster.com/ I follow these guys for similar reasons. They always seem to be a couple steps ahead of the rest of the industry and it's frankly a little embarrassing how productive they are. Come to think of it maybe I'd feel better about myself as a programmer if I stopped following them...
jlongster · 2011-03-16
Thanks! I haven't used Scheme in a while because I got tired of focusing so much on something without a big community. I want to get back into it though, specifically with game development. Checkout http://jlongster.com/ over the next couple months and I'll start posting again. Scheme is great but you should also involve yourself in a popular language with a big/fun community so you don't burn out. Seeing different perspectives is good anyway. Looks like iScheme came out after they backed off of their only Objective-C/C rule. So it should be fine, simply because it doesn't download any scripts. I think that's the only restriction now.
samwillis · 2021-12-01
This is a good writeup. It's worth noting that this loads the entire db into memory, and only saves to the filesystem when you tell it to (not on each transaction) so you could loose changes on a crash. There is a brilliant project to add true transactional flushing and a block like storage backend to WASM Sqlite.js called "Absurd SQL", worth checking out. It's currently built on top of IndexedDB but they are working with the WG designing the FileSystemAccess APIs to ensure it has suitable block level support and locking for this type of tool. https://github.com/jlongster/absurd-sql https://jlongster.com/future-sql-web
rkuykendall-com · 2017-09-26
I always recommend this article to people who want to learn react, as it focuses on the concepts and not the code, which actually differs a lot on if you use a JS compiler: http://jlongster.com/Removing-User-Interface-Complexity,-or-Why-React-… The author creates a library, piece by piece, which introduces the same concepts. Makes it much easier to jump into the 'real' framework.
chowes · 2015-11-27
Check out http://jlongster.com/A-Study-on-Solving-Callbacks-with-JavaScript-Gene… and the follow up post. It's easy enough to start using generators alongside your existing async solution (callbacks or promises). Proxies can be used for data-binding, similar to Object.observe. I've also yet to find a case where I need WeakMaps instead of an Object or Map. All the benefits seem to be a bit too theoretical, but I likely haven't dug into it hard enough.
stoikerty · 2015-02-10
There is a video that describes "Immediate-Mode Graphical User Interfaces" really well, see: https://twitter.com/stoikerty/status/467047333453381632 There is also a lengthy and insightful blog-post about the subject where I found the video: http://jlongster.com/Removing-User-Interface-Complexity,-or-Why-React-…
rapind · 2014-12-24
This post is just pushing web components / polymer with a controversial title right? I don't think it's production ready yet though (slow polyfills), and there's some differing opinions on how web components should be built. Here's an interesting and fairly detailed article about a different approach: http://jlongster.com/Removing-User-Interface-Complexity,-or-Why-React-… Best of both worlds? https://github.com/PixelsCommander/ReactiveElements
ultimape · 2014-11-21
For those not familiar with Clojure, here's a great demonstration of the concept done up in JavaScript: http://jlongster.com/Transducers.js--A-JavaScript-Library-for-Transfor…
fvdessen · 2014-04-25
I mean the yield by itself is not a good API, it has to be wrapped in third party Deferreds libraries to be useful - there's an (excellent) linked article which explores this approach : http://jlongster.com/A-Study-on-Solving-Callbacks-with-JavaScript-Gene…
rrradical · 2014-03-07
I didn't use many libraries. It's pretty straightforward to interface with C code, so instead of writing a whole OpenGL wrapper, I just call into some C code to handle the rendering. It was somewhat tricky to get it all setup, but I followed in the footsteps of James Long (http://jlongster.com/s/jlongster-old/pages/blog/write-apps-iphone-sche… and a few others. I hope to contribute back what I learned and make it easier for others to use it for games in the future. It's seriously a great language for game writing.
e12e · 2013-12-08
I suppose what I was really wondering, but cleverly hid in formulating my comment, was "what are read[er] macros?". That'd be how you could redefine "{" and "}" to work something like this? At least I came across the following that seems to indicate that: http://letoverlambda.com/index.cl/guest/chap4.html http://jlongster.com/2012/02/18/its-not-about-macros-its-about-read.ht…
Vekz · 2011-04-22
jlongster I was closely following your blog posts about Gambit-scheme on the iphone and was even inspired to try it myself. However this was shortly before Apple changed the developer agreement to add the "stuff that compiles to objective c is not acceptable" clause. It appears as you have discontinued this project. Was that clause the reason? here is his blog for reference: http://jlongster.com/legacy/scheme-iphone-apps.html
julian37 · 2010-12-29
If I could somehow appropriate the Scheme-to-LLVM compiler for producing ARM code to run on the iPhone! Doing what Gambit Scheme does [1] without Gambit Scheme would be great. The LLVM code it generates looks pretty neat [2]. Alas, it looks like the source code for this is not available. [1] http://jlongster.com/software/iphone/scheme-iphone-example/ [2] http://impromptu.moso.com.au/extras/imp_tech_notes.pdf
posobin · 2021-09-29
Actually Ampie used to work differently: Ampie would store the local cache of links from your twitter feed and links submitted to HN, and check against it when you went to any web page. If there were hits, it would show a small tab in the bottom right corner, showing that there are N tweets, M HN submissions with this page. Then you could click on the tab and the sidebar would pop up, so no requests were sent until you actually clicked on the tab. There are two problems with this: first, the cache had to be large, several hundreds of megabytes, because there are a lot of links (~200k from HN, and each person I follow on average tweeted 1k links among the last 3k tweets that twitter lets me access) and indexeddb is not memory-efficient. Second, this is easy to miss, and those numbers alone don't give enough information to go through the effort of clicking there every time. And this doesn't include the backlinks and HN comments mentions (fun fact: there are about 4m URLs mentioned in HN comments), so you'd miss out on a lot of stuff. You could suggest Bloom filters as caches, but that is a bad solution since now you only can show if there is a hit or not (instead of two numbers), but also there are false positives so the sidebar is not reliable anymore, and given that you go to hundreds of URLs a day, the FP rate has to be really low which makes the cache really large. Maybe using something like https://jlongster.com/future-sql-web would have reduced the memory usage, but at…
TheAceOfHearts · 2017-05-28
Nice write-up. I've been popping my head on over to their project every few months to check out their progress. Something that's pretty cool is that they're using Flutter to write Fuchsia's UI [0]. My favorite thing about Flutter is that it looks like they took some heavy inspiration from React. If anyone reading this isn't familiarized with React, or they don't really "get it", I'd highly suggest reading the Removing User Interface Complexity, or Why React is Awesome [1]. One of the big problems with implementing a UI toolkit is having to re-implement everything relating to accessibility. Although it's totally understandable that they're still focusing on the core. Something I'd be interested in seeing is how Dart and Flutter might affect battery life. I'd expect the stock UIs to be pretty well optimized by now, but I have no idea how Dart stacks up in performance. [0] https://github.com/fuchsia-mirror/sysui [1] http://jlongster.com/Removing-User-Interface-Complexity,-or-Why-React-…
firasd · 2016-05-27
This is a very useful walkthrough. Some links for those who are also interested in "Thinking in React" in a more conceptual way (#4 is a presentation from the same person who wrote the walkthrough): 1) React — Basic Theoretical Concepts: “A description of the conceptual model of React without implementation burden.” https://github.com/reactjs/react-basic 2) Pure UI: “A lot has been written about the merits of React as a framework. Today I’m compelled to write about the benefits of a programming model it enables and its implications to the design and creation workflow." http://rauchg.com/2015/pure-ui/ 3) Removing User Interface Complexity, or Why React is Awesome: “I’m mostly concerned with the core problems of data binding and componentizing UIs. After much research and usage of the technologies mentioned above, I found React to provide the best solution.” http://jlongster.com/Removing-User-Interface-Complexity,-or-Why-React-… 4) Pete Hunt: React: Rethinking best practices (youtube): “building views with JavaScript, ‘re-​rendering’ your entire application when your data changes, and a lightweight implementation of the DOM and events.” https://www.youtube.com/watch?v=x7cQ3mrcKaY 5) Nothing new in React and Flux except one thing: “What is it that makes React so innovative and compelling?… The Virtual DOM allows us to convert a mutable retained mode graphics API to an immutable functional immediate mode API.”…
kenOfYugen · 2016-03-25
> Generators are JavaScript's programmable semicolons. Lets not take away that power by taking away the programmability. Lets drop async/await and write our own interpreters. One of "our own interpreters" (i.e not standard in JS), that I am very fond of, is js-csp [1]. It's a replica of Clojure(Script)'s core.async, or Go's channels/goroutines. It uses ES6 generator functions underneath. James Long has written an excellent post about it [2]. I find it to be the less taxing on the mind solution for coordinating complex asynchronous processes in JS, especially when paired with transducers [3]. Furthermore, powerful Go/Clojure patterns can easily be re-used in JS. In conjunction with CoffeeScript, the code becomes elegant and straightforward since there is no 'function*' ugliness required. That's the least complex solution I have found to like the most. Performance and memory usage suffer a bit, but it's very straightforward to optimize if/when needed. [1] https://github.com/ubolonton/js-csp [2] http://jlongster.com/Taming-the-Asynchronous-Beast-with-CSP-in-JavaScr… [3] http://jlongster.com/Transducers.js--A-JavaScript-Library-for-Transfor…
skrebbel · 2014-11-01
I've been using this (v2, though) rather extensively the last few months so I figured I'd share some experiences. First off, it works great. The TypeScript definition file also works fine as an API documentation of sorts, although it would be nice if some web site with a clickable TOC could be generated from it. I was a little confused at the beginning how the "Sequence" base class (changed name to Iterable in v3) was an arbitrary key=>value mapping (with no apparent relation between the keys and the ordering of the key/value pairs) that I had expected would be called "Map". The name change made this clearer for me: it's basically an abstract interface, not a concrete datastructure. The TypeScript support, to my experience, does not work as advertised on the tin, especially when you nest data structures. For example, code like this compiles fine: var q = Immutable.Map<string, Immutable.List<number>>(); q.set("hello", Immutable.List([1,2,3])); // typechecks until here q.updateIn(["hello", "wrong"], false); // shouldn't be possible, but is. Similarly, if you use Immutable.Record to build immutable objects, then you can still call set() with any key because the key is a string instead of something TypeScript could typecheck. Meanwhile, using direct property access on Immutable.Records, like this, will fail: var Banana = Immutable.Record({length: 0, colour: "yellow"}); var someBanana = new Banana(); someBanana.curve = 5.0; // should fail, but…
Retr0id · 2024-06-26
Per [0], surprisingly, you can beat IndexedDB performance by layering another DB engine on top. Discussed on HN: https://news.ycombinator.com/item?id=28156831 [0] https://jlongster.com/future-sql-web
DylanSp · 2023-01-12
This is definitely better, yeah. The blog post[1] on absurd-sql notes that it's a hacky solution that would be improved with file system access; it references the old Storage Foundation proposal [2], which has since evolved into the current File System Access API proposal(s). [1] https://jlongster.com/future-sql-web [2] https://developer.chrome.com/docs/web-platform/storage-foundation/
vdm · 2022-01-25
sqlite vfs on browser indexeddb: https://jlongster.com/future-sql-web
dorian-marchal · 2021-12-29
I believe the absurd things are: - the idea (i.e. storing a database in a database) - the fact that the resulting storage is faster than vanilla indexed db. The repo's readme is a bit misleading and it does make it look like a mad scientist experiment but you can read more about it here (really interesting stuff): https://jlongster.com/future-sql-web Obviously this project is still young, but I find it convincing (disclaimer: I don't use it yet).
tkzed49 · 2021-11-01
you might want to sit down for this one, but we're pretty close (sqlite): https://jlongster.com/future-sql-web
sgarrity · 2021-10-29
How does this compare/relate to https://jlongster.com/future-sql-web (if at all)?
dmw_ng · 2021-10-26
The complaint was about IndexedDB access, not local memory. Folk mentioning this are usually referring to the disastrous implementation in Chrome: see https://dev.to/skhmt/why-are-indexeddb-operations-significantly-slower… and https://jlongster.com/future-sql-web
gnabgib · 2021-08-12
Doesn't look like your project Tim? (so the title shouldn't include Show HN). The blog post [0] from James seems to be a better link. https://jlongster.com/future-sql-web
some1else · 2018-09-19
The pitfall being that this approach only works with string arguments. Having some Ruby experience, I don't like any of the JavaScript DSLs using template strings for function invocation so far (like styled-components and graphql), and would rather just use macros: - Sweet.js: https://jlongster.com/Stop-Writing-JavaScript-Compilers--Make-Macros-I… - Babel-plugin-macros: https://github.com/kentcdodds/babel-plugin-macros
mudetroit · 2016-08-17
I found this one of the more detailed articles about the differences and why one might favor react http://jlongster.com/Removing-User-Interface-Complexity,-or-Why-React-…

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close