News for hackers. Stuff that matters.
Re:Six programming languages I’d like to see by abrax3141 on Wednesday July 13, 2022 @10:38AM (#32083388)
“Everything is a graph”

This is sort of an odd thing to want. You need a diversity of data structures. And BTW the acronym not withstanding, lisp represents graphs not lists.

Re:Six programming languages I’d like to see by chickenpotpie on Wednesday July 13, 2022 @02:47PM (#32087078)
Under the hood, almost every data structure is a graph.

Linked lists, trees, and heaps are all just graphs with certain requirements about their structure.

Everything else can be represented as a graph, just not as elegantly.

Also as a data point, I really really wish there was an everything is a graph language. I work in graphs all day (in the private industry) and I have to keep modeling them as arrays. It's a pain.

Re:Six programming languages I’d like to see by vinodkd on Thursday July 14, 2022 @09:45AM (#32096026)
I'm a little late to the party, but humbly submit my thoughts/design from a while back for your review/feedback: https://github.com/vinodkd/halo/blob/master/doc/UserGuide.md...

Edit: I've posted this same comment in multiple places in this conversation to get feedback from specific commenters, not as spam (it's a old personal project)

Re:Six programming languages I’d like to see by SeanLuke on Wednesday July 13, 2022 @11:34AM (#32084121)
How so? The cons data structure only points to a single object. You could do singly-linked lists and trees (only with kids pointing to parent) and that's about it, right? And I guess simple loops?
Re:Six programming languages I’d like to see by abrax3141 on Wednesday July 13, 2022 @11:47AM (#32084327)
The cons is a directed edge.
Re:Six programming languages I’d like to see by SeanLuke on Wednesday July 13, 2022 @12:54PM (#32085388)
To have a graph, in general, you have to have multiple directed edges from a given object. A cons does not offer this, and the best you could do would be to treat cons cells in a extremely convoluted way as binary hypergraph nodes.

You said: "lisp represents graphs not lists". I think you meant that Lisp's defining data structure, based on the cons, was for general graphs, not lists. But that is not really true. If what you meant was "Lisp isn't just restricted to linked lists", sure, but that's true of every programming language with object arrays. So what?

Re:Six programming languages I’d like to see by abrax3141 on Wednesday July 13, 2022 @05:00PM (#32088688)
Well, that's part of my point. However, in Lisp you get to macro the language into whatever you like, so you can make lisp into the desired graph language, layered on CONSs, but not so much with other languages because only in Lisp do you get to create an entirely new language. (People think of Lisp wrongly as a programming language, whereas it's really a meta-programming language.)