4 ms·
How would this compare to Pypy? I didn't think Pypy uses LLVM so I wonder who produced better code. That said, they're targeted at different audiences. I feel
by samsquire 4y ago
How would this compare to Pypy?
I didn't think Pypy uses LLVM so I wonder who produced better code.
That said, they're targeted at different audiences. I feel Numba is targeted at data science and machine learning and even AI.
I feel a large portion of using or programming a computer is structural and not the actual work of adding numbers together. Very little of the code generated does the useful part a computer does: addition. The rest is control flow management and data placement! It's all preparation for the code to do an addition. The hard part is putting together the structure for the computer to do things that are useful.
So we invented methods, variables, classes, functions, closures, expressions to create that structure easier.
I thought about creating a language which tries to eliminate the structure that most programs accumulate and focus on the critical addition or calculation and let the computer do the arrangement. A JIT compiler for structure.
- csdvrx 4y ago> let the computer do the arrangement Isn't that constraint propagation? I'm discovering JS at the moment. I don't fully understand the async model, but the promise seems like a generic constraint of "the result is now available" Maybe you could have the "flow managements" as other constraints?
- samsquire 4y agoThank you for your reply. I'm thinking the code for your average CRUD or even desktop compositor. A compositor copies pixels from multiple places into one place. Surely that can be defined with a simple loop? But no there's hundreds of APIs in the way. Add Wayland and X11 and you have something that is opaque and understood by very few people. The motivation behind my comment was that most of programming computers is gluing together APIs to shift data from one place to another before doing something useful with it. The APIs themselves do very little addition or subtraction of data but actual just moving data around and placing it into the right place. Maybe defining where things should be, declaratively, in order to do a calculation would be useful. So the shape of the calculation defines the data structure, rather than the data structure defining the caclulation.
- csdvrx 4y agoFor a compositor, I'd think of the set pixels being changed (an "invalidation") a good example: the constraint would be to update it on the screen. Unchanged? Don't bother, leave it as-is. I think that's how Intel power saving works. Now think about the MVC model: some changes in the data could result in a change in the view if the data currently shown on screen is what has changed - like triggers in SQL. I wonder if you could have everything work like that?
- samsquire 4y agoYou're right, and thank you for bringing async up. And thankyou for bringing up constraint propagation. One of my ideas is the definition of formulas that act as materialized views over other materialised views. So we can layer materialized views over other materialized views and then work out a derived formula that is potentially nearer to what we want and potentially summarise the formula without needing to calculate the underlying views, we can compute the formula directly. Is this differential dataflow? I think it's an application of algebra and JIT compilers could do it to expressions if we fed symbolic expressions of programming languages into sympy or machine algebra. In react, react does diffing between virtual DOM nodes to see if there are changed. There is also dirty region checking in old games and damage regions. These problems are mathematically defined. Here's my writings on the idea https://github.com/samsquire/ideas4#31-algebraic-materialised-view-edits-and-whole-program-optimisation https://github.com/samsquire/ideas4#31-algebraic-materialise...
- csdvrx 4y ago> I think it's an application of algebra and JIT compilers could do it to expressions if we fed symbolic expressions of programming languages into sympy or machine algebra Yes and the constraints could be the used to reduce the computational costs, giving higher performance and lower latency. A while back, a good friend (we even shared HN accounts for a while lol) pointed me to pipelinedb: a PostgreSQL timeseries plugin for continuously updating """materialized views""" I use a lot of quotes around, because it wasn't either like a regular view (computed when you query it, which introduces latency) or a materialized view (frozen, needs to be refreshed, same problem) but more like the NO_HZ tickless kernel: the update of the calculations was caused by the introduction of new data, not the passage of time (which would be wasteful) The general approach makes a lot of sense to me, and I see how it could be used for more generic problems.