Better HN
topnewbestaskshowjobs
Log inSign up

dustingetz

7,912 karma · joined Sep 11, 2009 (17y ago) · 3,625 submissions

Founder Electric Clojure https://github.com/hyperfiddle/electric

https://twitter.com/dustingetz

Submissions

751.

RFC 8949 Concise Binary Object Representation(cbor.io ↗)

4 points · by dustingetz · 3y ago · discuss

comment 3y ago · link · parent

Git subtree – can anyone vouch for this as an alternative to submodules for an open source business? Any hidden gotchas or friction points?

comment 3y ago · link · parent

taxes!

comment 3y ago · link · parent

"thirst trap"

755.

Life lessons from differential equations – John D Cook(johndcook.com ↗)

3 points · by dustingetz · 3y ago · discuss

756.

A Relational Spreadsheet(kevinlynagh.com ↗)

172 points · by dustingetz · 3y ago · 73 comments

comment 3y ago · link · parent

How do y'all organize your youtube queue, is there third party software? Looking to streamline this to make it "netflix easy" as I am inevitably feeling tired when allocating leisure time to this. I have a couch laptop, chromecast and iphone

comment 3y ago · link · parent

move to denser forms of communication i.e. math notation

comment 3y ago · link · parent

doubt those two numbers (workforce payroll and real estate cost) are within the same order of magnitude

comment 3y ago · link · parent

follow the money to understand the decision making; it’s almost always locally rational for some situation that is non-local to you and typically is a higher dimensional problem than you assume.

a good place to start is to ask how the boss became the boss, given that the boss quality inevitably degrades to Dilbert

comment 3y ago · link · parent

Likely this thing, or a lagging version, is already hooked up to weapons in classified military experiments, or about to be

comment 3y ago · link · parent

You're right, over-abstracting is a primary risk and has been top of mind for us since project conception in ~2012. ORM, for example, is a nightmare of over-abstraction (remember Spring Framework's AbstractSingletonProxyFactoryBean?). In fact, studying the O/R impedance mismatch from first principles back in ~2010 was what led me to functional programming in 2011.

Electric is an attempt to find exactly the right level of abstraction. The goal is to remove and flatten layers, not add them, thus decreasing abstraction weight in the end if we succeed. Maybe we fail, but first let me share some details about how we think about this:

1. I've personally failed to build this project several times, Electric Clojure is something like the 7th attempt.

2. strong composition model as a starting point, based on category theory generalization of "function" -> "async function" -> "reactive function" -> "stream function" -> "distributed function". ORM does not have this. (This rigor is in response to the past failures.)

3. Functional effect system (monad stuff) at the bottom, which provides strong semantics guarantees about glitch-free reactive propagation, process supervision (like Erlang) (transparent propagation of cancellation and failure), strong resource cleanup guarantees (DOM nodes can never be left hanging, event handlers can never fail to be detached and disposed). Already this results in tighter operational semantics than we have ever achieved with manual resource management (and, again, we tried, see past failures). Our functional effects library: https://github.com/leonoel/missionary

4. Electric affords the programmer trapdoors to the underlying FRP/concurrency primitives. Electric is essentially a Clojure-to-FRP compiler, so if you code raw concurrency and effect management, that actually typechecks with what Electric generates, allowing seamless transition in and out of the abstraction.

5. 3k LOC + 3k test LOC is the size of Electric today (includes a rewrite of the Clojure analyzer). Spring Framework is, let me go check, 59k just for `spring-core/src/main/java`, and there are like 20 other modules I excluded. Indeed it is not a fair comparison but certainly we have complexity budget to spare.

comment 3y ago · link · parent

that’s right!

comment 3y ago · link · parent

Great question. A trivial example, expr (e/client (inc (e/server (e/client x)))) should simplify to just (p/client (inc x)) and eliminate the pointless (and perf-damaging) server round trip.

It gets interesting when you introduce lambdas, revealing that this optimization is non-local – you don't know if the transfer is superfluous until you know where the function is called from, and consider the caller and callee together.

The good news is that the DAG (Circuit really) contains everything there is to know about the data flow, so insert compilers research here and poof, insanely fast app.

comment 3y ago · link · parent

One quick sketch of offline-first (there are many other ways):

imagine a database like DataScript (already OSS and built in Clojure), move key components like the query engine into Electric Clojure, now the "DAG slice" can cut right through the query engine and it's internal data structures, such that the indexes are partially on the client, and the final stages of query filtering are on the client. A network-transparent database! The bulk of the work, and sensitive data, stays on the server; but the last mile user data querying happens on the client. Electric can transparently move portions of the underlying database indexes to the client for local offline query.

0 LOC cost to userland! No loss of relational query when offline! No performance cost of putting the entire query engine in the browser (a low compute environment)!

comment 3y ago · link · parent

Re. abstraction weight - You're right, it's true that the program is less inspectable than before, and that it adds more distance between programmer and metal. We're aware of the issue and have already begun – we landed async stack traces a while ago (which works about the same as in React.js).

And yet. It's also true that HLL (high level languages) like C, Java, Python all faced the same issue. The benefit is a huge gain in terms of ability to reason about ever larger programs. Java gave us garbage collection. Not everyone liked that; C++ developers want to manage their own memory. But at what cost?

Our thinking is: first get the semantics right. Then polish the experience (today we are here). Then add observability tools. Then make it fast. And if we've screwed up the semantics, then the project will fail for the reasons you describe.

The saving grace is we're seeing 10x LOC reduction (18k to 2k) in rebuilding Electric's sister project, Hyperfiddle (a spreadsheet like tool for robust UI development), as well as massive gains in performance.

Re. offline-first - we think the model can be extended to that but this is a blog post for another day

comment 3y ago · link · parent

yup! For a sneak peak - https://hyperfiddle.notion.site/Hyperfiddle-progress-report-...

comment 3y ago · link · parent

(founder here) You're right that accidents can happen, and if we need to build in safeguards to prevent accidents (i.e. tag a value as server-only) – that should be trivial. To be clear, your backend still exists and has the same security model as a REST Backend-for-Frontend. The client/server markers denote at compile time where a computation (function) must occur. A scope binding like `password` will only transfer if the programmer asked it to by using it from a client region. That would be like putting passwords in a REST payload – it's a programming bug and should be caught in review. But you're right, providing safeguards is a great idea.

comment 3y ago · link · parent

(Founder here; I'll address the debugging concern in a separate comment)

Here's a demo of React.js interop via Reagent, the wrapper is 25 LOC: https://gist.github.com/dustingetz/9854d23037b55bfab3845539f...

Our DOM module is only 300 LOC - it's bare metal DOM point writes + Electric (reactive language) + macros for JSX-y syntax. When the programming language itself is reactive, DOM rendering falls out for free.

Mechanically, Electric is comparable to Solid.js except the reactive engine is general purpose, not coupled to DOM rendering, which is a special case of incremental view maintenance.

Electric's reactive engine is https://github.com/leonoel/missionary ; Electric can be seen as a Clojure to Missionary compiler (if you ignore the distribution stuff - which btw is optional). Missionary is cross-platform functional effect and streaming system that today is tested on JVM, Node and Browser platforms. Missionary was created by Léo Noel, who is also the architect of Electric.

comment 3y ago · link · parent

(founder here) We got here from first principles by thinking deeply about pure functional programming. A lot of what is happening in pure FP ecosystems is "http servers but with monads" and we think that misses the point.

comment 3y ago · link · parent

(founder here) Should be straightforward; as you discovered, everything is properly backpressured by the compiler (automatically!) so no state is lost.

comment 3y ago · link · parent

(founder here) Thank you Dennis! All, broadly, to date we've focused on achieving correct program semantics over syntax/perf/ux/dx. We're rotating onto these issues now, since we've reached a point where, after 2 years of hardcore dogfooding and 8 months of private beta, we're comfortable that brave Clojurists like Dennis will be successful and have an acceptable development experience. (Especially when compared with the benefit of strong composition at the system level - functional programming over entire systems!)

comment 3y ago · link · parent

Founder here - woke up to this. Here is some context for HN:

Demo videos: https://hyperfiddle.notion.site/Electric-Clojure-progress-De...

Prior HN discussions addressing many of the FAQs: https://news.ycombinator.com/item?id=28630209 https://news.ycombinator.com/item?id=31217448

Some notes on the network layer: https://www.reddit.com/r/Clojure/comments/vizdcc/hyperfiddle...

I'll try to address some FAQs in another post

comment 3y ago · link · parent

in the USA it’s been possible to get COL down to sub $50k for a comfortable life and live on 3 mos a year of freelancing mainstream stack stuff, you can focus on long term research indefinitely without distractions. Main downside is can’t live in SF/NY so your project better work out. if you weren’t gonna chase money anyway then what difference does it make?

775.

By way of introduction – EWD 1041 (1989)(cs.utexas.edu ↗)

97 points · by dustingetz · 3y ago · 66 comments

comment 3y ago · link · parent

selection bias is omnipresent which is why everyone is welcome to add facts to the discussion, as in the case in courts and the scientific method, so that scientists and juries can come to their own independent judgments rather than relying on an Ordained Authority. In science, if there is not consensus, we loop and add more facts until there is.

comment 3y ago · link · parent

he provided a fact, which is an observation of reality. you provided a judgment, which is a projection of the judge.

comment 3y ago · link · parent

read math textbooks. far higher quality information and scrolling is just boring in comparison

comment 3y ago · link · parent

modern FP (effect systems) says the opposite - having separating the pure from the impure, we can now bring them back together and orchestrate fine grained fabrics of effects at greater scale with deterministic lifecycle and strong real source cleanup guarantees; for example signals based reactive dom rendering
1
252627
121