Better HN
topnewbestaskshowjobs
Log inSign up

thesz

2,710 karma · joined Aug 2, 2010 (16y ago) · 1,844 submissions

The site I care about: http://thesz.livejournal.com (Russian)

I use "sergueyz" login on universally recognized google mail service.

Submissions

comment 2d ago · link · parent

https://en.wikipedia.org/wiki/Lazy_evaluation

"In programming language theory, lazy evaluation, or call-by-need, is an evaluation strategy which delays the evaluation of an expression until its value is needed (non-strict evaluation) and which avoids repeated evaluations (by the use of sharing)."

Algol-68 had call-by-name semantics for function arguments and it was not called lazy.

Haskell and Miranda before it, and LazyML before both of them, have call-by-need evaluation and they are called lazy.

comment 3d ago · link · parent

From the software engineering perspective, the fun part is where you can introduce defects into the code. The main process of gaining experience is to get knowledge how and get oneself able not to introduce errors into the code.

With the removal of the fun part, you also removed the part that you can improve by yourself.

comment 4d ago · link · parent

I also do not understand what you call higher order sharing. Can you provide a definition and/or paper or presentation about it?

Why is incremental higher order sharing is important?

Can interaction combinators be implemented with just lazy (graph reducing) computations?

https://bathtub-01.github.io/technical/ouros-demo/ - that was on Hacker News front page not so long ago. It is a data flow CPU implementing Haskell through graph reduction.

This is why I consider graph reduction and data flow superior to interaction nets.

comment 4d ago · link · parent

Call-by-name is not lazy, because it will perform the same computations whenever value of the computation is required.

comment 4d ago · link · parent

Lazy evaluation (call-by-need) is normal reduction order for lambda calculus with memoization (nothing is reduced more than once). It has been proven a long time ago that if lambda expression has a non-reducible form, it can be reached with normal reduction order, but not always with the others (eager reduction being one such example - Lean uses eager/strict evaluation, thus it is... interesting).

comment 4d ago · link · parent

  > I wonder whether interaction nets are more amenable to hardware implementation?
I've finally found it!

https://en.wikipedia.org/wiki/TRIPS_architecture

"TRIPS uses an instruction set architecture designed to be easily broken down into large groups of instructions (graphs) that can run on independent processing elements. The design collects related data into the graphs, attempting to avoid expensive data reads and writes and keeping the data in high speed memory close to the processing elements. The prototype TRIPS processor contains 16 such elements. TRIPS hoped to reach 1 TFLOP on a single processor per paper published from 2003 to 2006."

These pesky interaction nets are TRIPS in disguise. TRIPS is a kind of reduced data flow CPU.

comment 4d ago · link · parent

  > same as interaction nets, no?
Exactly my point. But well researched and has compilers from high level languages (Id and some others).

  > except they are strongly confluent and have incremental sharing
Data flow is an inverted representation of data demand (lazy evaluation, which is strongly confluent) [1] and I do not see why it cannot (be constrained to) have strong confluence.

[1] https://dl.acm.org/doi/pdf/10.1145/93548.93578

Have authors compared interaction nets to the data flow machines? No.

They did not even compared their results to the Transport Triggered Architecture [2] automatic core construction workflow.

[2] https://web.archive.org/web/20051125195128/http://ce.et.tude...

In some cases (FFT), TTA's automatic synthesis was able to provide power-per-operation reduction of three orders of magnitude, when compared to specialized ASIC hardware.

comment 4d ago · link · parent

  > without having to figure out the parallelism...
Parallelism can be regular (matrix or tensor operations are examples of that) and irregular (Barnes-Hut as a very simplified example). To extract something like Barnes-Hut from the code with quadratic complexity, one have to make some interesting assumptions. E.g., one has to figure out something.

One may think that regular parallelism is a solved problem, but even nested loops are not always parallelizable without figuring out how to make them to work in parallel.

Then there comes Microsoft Word. Can we make a CPU where Microsoft Word gets executed with maximum IPC achievable? If you do not like MS Word, take a look at Linux Kernel and userland programs as a whole.

comment 4d ago · link · parent

I think that data flow computing paradigm subsumes interaction nets.

[1] https://en.wikipedia.org/wiki/Dataflow_architecture

Every step there is local, every dependence is explicit and every value has only one owner.

comment 5d ago · link · parent

  > So rich have way more options, its completely up to them how much they lean into it.
Yes, they have much more options. Yes, the question is how much would they lean into it.

This Youtube channel has videos of his owner eating at many haute cuisine restaurants, including three-Michelin-starred ones: https://www.youtube.com/@HarrisonWebb97/videos

The calories and amino acids profiles of haute cuisine food presented there are not all that healthy. At least, not all the time, from what I was able to gather. These profiles are about at same level as, I do not know, something like street fast food.

If rich ones do not control everything and anything their chefs do, chefs will change their cooking to what they were trained for. And in case of multiple-Michelin-starred-restaurant-trained chef, it will be multiple-Michelin-starred-restaurant food, only slightly (in most important regards) different from street fast food.

comment 5d ago · link · parent

I think that they just eat more of the same.

Gout, a illness of the royals, is associated with prediabetic state, which is "achieved" through elevated consumption of carbohydrates.

comment 5d ago · link · parent

Chef made meals most often have the same calorie profile (carbs, protein and fats) and amino acids profile as ultraprocessed junk.

comment 5d ago · link · parent

  >  ...it was at least a little reassuring that this disease didn't spare even obscenely wealthy people.
The obscenely wealthy people eat mostly the same food as obscenely unwealthy people do. From [1], one can conclude that it goes for 3000 years now, probably longer.

[1] https://www.youtube.com/watch?v=uncd7SvT94c (pharaohs eat same food as the lower classes of society, judging from the teeth wear and decay)

comment 1w ago · link · parent

Haskell was used for all kind of blockchains. While blockchains themselves are not very valuable and even laughable at times, in my not so humble opinion they represent very complex software.

In 2019 my colleagues made a Byzantine fault tolerant database with 16K+ TPS throughput, using PBFT-like consensus implementation and signed transactions. It was capable for such throughput being geodistributed.

Some 16+ years ago I was very interested in electronic hardware design. One of the typical errors in this area is the use of values from different clock domains. By using phantom clock parameter in the Wire type, I prevented this particular class of errors.

What I've found in my line of work, is that simple implementations of parser combinators in the style of Parallel Parsing Processes [1] had quadratic complexity for regular parts of context-free grammars when implemented with C++ and C#, but superlinear and subquadratic (around O(N^1.4)) complexity when implemented with Haskell.

[1] https://www.cambridge.org/core/services/aop-cambridge-core/c...

I use Haskell first for all my side projects, because I usually very interested in having something implemented correctly to check whether I understand the idea and then whether idea is worth pursuing at all. I do that for 28 years now.

comment 1w ago · link · parent

  > That's trivially true, of course, but this language doesn't currently exist.
This is a very bold claim.

I already wrote above that Haskell has MonadError, an effect that explicitly tells that code can panic. Rust does not have such facility.

Software transaction memory is implemented in Haskell as an effect, as a monad. It does not allow one to open a file unless transaction completes - the sequence of steps to open a file can be constructed in an execution of transaction, but these steps cannot be executed until transaction complete.

This eliminates second pattern of introduction of bugs into Rust's code: assuming user code is correct. With Haskell it is not possible to open, read and close file in the middle of transaction, by construction. In Rust, one have to pay attention.

So Haskell has ruled out at least two of three bug-introducing patterns of Rust.

comment 1w ago · link · parent

From the article: "The findings reveal three recurring patterns of misplaced trust in unsafe code: trusting code not to panic, trusting user-provided implementations to be correct, and trusting the underlying system."

The call to "panic" is an effect and can be checked at compile time. Haskell does this with MonadError class, marking up code that may throw.

Rust has Turing complete type system for years and still does not have effects of any kind.

To be fair, "trusting user provided implementation" is also has something to do with effects. Proper type system would require user-provided implementation to use only certain effects and nothing else.

So two of of found shortcomings are directly related to the type system and, specifically, to the choice of original Rust implementors to not to distinguish between pure and effectful computations.

Do Rust implementors highly competent? Yes, of course! They work on Turing complete type system. Will they eliminate two of three recurring patterns? I strongly doubts so. It is a design decision and these are especially hard to change. Changing it will also break all Rust source code produced to that point of time.

Is it a scandalous situation? For me, it is. The situation is so dire, actually, that "highly competent people working" has to be defended with trivially true fact that "bugs exist in complex software no matter how hard you try," instead of addressing core problem.

comment 1w ago · link · parent

  > Which begs the question is Software Eng'g/Development a mature profession?
I think that correct question is "does use of external LLMs and agentic coding make Software Engineering less mature profession?"

For every sense of the word pair "less mature," including, but not limited to, "less responsible for consequences of actions."

comment 2w ago · link · parent

  > Tendrils is answering the question: what if we redo the CPU? Instead of starting from a sequential design, we’re building our processor to have thousands of cores operating in parallel. This requires moving beyond the notion of shared mutable memory and linear instruction sequences. To make this possible, we’re working in tandem on the open-source language Vine, which has been designed from the beginning to target a new wave of parallel-first architectures.
So they used a new and unknown language Vine.

Ten days ago there was a post that linked a Haskell-specialized CPU, please: https://news.ycombinator.com/item?id=50319896

The link to the CPU demo: https://bathtub-01.github.io/technical/ouros-demo/

The Ouros CPU is a dataflow CPU, which means it is very, very scalable. It does not, from what I read there, contain content-addressable memory, which is a bottleneck for dataflow architectures. It supports multithreading from the ground, a parallel Haskell program will be executed very efficiently there.

There was an Id, a dataflow lenient functional programming language. The Id90 version of it was ported to Thinking Machines Connection Machine (then) supercomputer (I believe it was ported to CM-4 and CM-5).

Id90 programs running on Connection Machine demonstrated linear scaling to the available compute and, sometimes, even superlinear scaling - Id90's Content Addressable Memory was implemented in software and when CAM slice become smaller, there were less cache misses. Some of Id90 programs produced so much parallel computations that compiler had to introduce throttling so CAM will not overflow.

Here's a thesis on compilation of lenient functional programming languages to CM-5: https://www2.eecs.berkeley.edu/Pubs/TechRpts/1994/5850.html

I guess it shows that functional programming languages can be efficiently executed through parallel dataflow architectures and that dataflow architectures scale efficiently with compute.

I am putting it all here because I see the same pattern over and over again. People create some new language with some unknown properties (Rust, for example, got Turing-complete type system before being able to control for I/O) instead of first taking Haskell and embed their ideas there or, even, add an extension to play and/or investigate.

In this particular case, they take some Vine programming language instead of Haskell, despite Haskell already having several specialized CPU implementations, including dataflow one, guaranteeing scaling. And Haskell has a pretty mature infrastructure and tons of libraries.

Why? I don't know.

comment 2w ago · link · parent

  > say predicting missing words in Wikipedia articles, which you can't do successfully without a good understanding of English
This is word2vec model, one of - predict a word from context. The other one is to predict surrounding words (context) from a word. It did a good job when I used it, words' classes were impeccable for most practical purposes.

Word2vec is a two layer perceptron.

comment 3w ago · link · parent

It is a dataflow Haskell processor! Apparently, without content-addressable memory.

And it has multithreading support.

Fascinating stuff.

comment 3w ago · link · parent

Haskell's type system is very powerful. I already provided an example of the linearly-typed monadic code, but there are examples of how to implement Rust-like borrow checking, etc.

Linear typing and borrow checking are all about environment manipulation. Introduction of linearly-typed object creates a unique (through the code) reference to that object in the environment and use of linearly-typed object removes that reference from the environment. Borrow checking can work similarly.

So abstract interpretation of the program implicitly uses state of environment and implicitly modifies it.

Such state monad with typed environment was possible in Haskell as early as 2009: https://blog.sigfpe.com/2009/02/beyond-monads.html

Sets of types (generalized records) were available in Haskell from 2004: https://okmij.org/ftp/Haskell/dependent-types.html#HList

Basically, it was possible to embed Rust-like language into Haskell from 2009 on, the ideas were all there.

The thesis that I continue to read is about dependencies. These dependencies control effects of the different parts of the program and one of the first more or less successful and practical way to control effects was monads in Haskell and, after that, monad transformers.

From my experience with Haskell, I more than love Software Transactional Memory, implemented as a monad without access to general I/O. You just cannot delete file before reaching consensus between different parts of program on which file to delete. Or, you can match on the state of different channels, where matching requirements may include the presence and/or absence of specific kinds of data, not only in the heads, but also in the channel as a whole. When I read about Go channels and their matching semantics I was greatly disappointed with them.

comment 3w ago · link · parent

Claude was definitely trained on the bzip3's source code. It can use similar modeling approach, etc, we are not talking about direct use of the code.

So, does Claude-writte BWTSorter use modeling approaches similar to bzip3?

comment 4w ago · link · parent

How does it compare to bzip3 [1]?

[1] https://github.com/iczelia/bzip3

Did this Claude-written free compressor take anything from bzip3?

comment 1mo ago · link · parent

Thesis does not contain any reference to Haskell.

This is an important omission because Haskell's type system allows implementation of linear logic as library [1].

[1] https://jpaykin.github.io/papers/pz_linearity_monad_2017.pdf

Most of dependence tracking can be done with Haskell's type system, as a library.

comment 1mo ago · link · parent

Their other keys are also in 0..255 range. This is definitely not "really unlucky."

I guess they used (x `mod` 256) instead of (x `mod` (2^256)).

comment 1mo ago · link · parent

Add debug logging, delete debug logging.

comment 1mo ago · link · parent

Any substantial work on substantial software project can give you that. It is often the case with C++ that some logic resides in header files included by most of the project. If you change that logic, you have to rebuild your project and you will get mostly the same object and/or executable files for most of source code, but still slightly different [1].

[1] https://stackoverflow.com/questions/75452073/understanding-e...

Builds of some of projects I've been working on required 20Gbytes and more of disk space.

comment 1mo ago · link · parent

You also need a deduplication, because with simple copy on write you will have a copy for writing the same - change a byte in a file, get a copy, then change it back, get a duplicate.

Deduplication in ZFS needs 5G of RAM for 1TB of logical data - if you expect your agents to produce 2TB of data, you should provide 10G of RAM for deduplication.

comment 1mo ago · link · parent

  > Model SOTA moves faster than chips can be designed or produced.
From what I remember working in that area the hardest part is getting masks for a design. Masks were developed in the span of half an year. Masks also reusable, they can be mixed and matched and this is why fabless companies work with fabs to produce specialized masks for them, it saves time for consumer to have masks for some macroblocks prebuilt.

Here's my analysis of how to etch relatively big LM into silicon: https://news.ycombinator.com/item?id=47109252

Given some amount of work with the fab before main pipeline set (I think a year long process), one can then spew LM-on-a-chip in six months or less and much more than 2 per year, because there can be several LMs in pipeline.

comment 1mo ago · link · parent

  > Matrix multiplication is after all nothing but an aggregate sum over a cross join.
https://www.vldb.org/pvldb/vol13/p1919-wang.pdf

They converted linear algebra expressions into relational algebra expressions, optimized them using equality saturation and converted back into linear algebra. With some noticeable speedups.

They used relational algebra for optimization because relational algebra has canonical form - there is only one most optimal expression.

And, equality saturation is most efficiently implemented using generic join algorithm.

12345
62