Live data from Hacker News

Beads: Computer language and toolchain

beadslang.org

201–210 of 235 posts

Re: Beads: Computer language and toolchain

#201

I would seriously consider toning down the marketing speak. This project is making very bold claims, without citations, while trying to appeal to an often skeptical crowd (developers). "Graph databases are considered more powerful and modern than relational databases," ... okay? According to what benchmark and for what workloads? A statement like that is an immediate turnoff because it is dismissive of 30 years of da…

Hi, I would like to chime in here on your comment on the marketing speak of the Beads project. I know the author of Beads, and was happy that he gave me a shoutout for my own project, Visual Javascript. Anyway, I have been following this new coding space for a while and I was also the initial angel investor for a project called Eve (the follow up for Light Table) which was an excellent project made by someone called…

I am vaguely familiar with Light Table and Eve (coincidentally my college roommate grew up with Chris but I don't know him personally). It's been awhile but my recollection is Light Table/Eve had a more targeted set of selling points -- a killer IDE with some slick features I hadn't seen before and then a new language designed to be written as prose.

Regarding Beads: time travel is definitely a cool feature. Most languages have some kind of step debugger but the experience can often be improved. Having a built in graph DB could be an interesting selling point too. I'd love to see a quick example of what having a graph DB built into the language enables. For instance, this post https://news.ycombinator.com/item?id=27315018 cites a Neo4j demo that, in a few lines of code, shows me something their product does "better" than SQL. I would love to see, on the Beads front page, a small (5 lines max?) code blurb that shows me something Beads can do harder, better, faster, stronger (or whatever ;) ) than other languages. I don't quite know what that is, but I imagine the author has some thoughts :).

Happy to connect more if you'd like.

Re: Beads: Computer language and toolchain

#203
post #72

A few months ago, I watched some videos by Brett Victor and decided I wanted to develop a visual programming language. That led me to https://futureofcoding.org/ and its slack channel. There was some cool stuff happening on the server, and the admin was doing his best to elevate things, but that slack channel was also the last stop for some people before they descended into templeOS levels of madness. Right around th…

I don't think you're fully appreciating the context here... The moderator of that community had been trying over and over, both privately and in public, to get this person to follow community norms for years, but they just would not do so.

To me, who has been in that community for years, it was entirely the correct action to take. Moderation is hard and no fun at all, but it needs to be done, or else a community will descend into madness.

Re: Beads: Computer language and toolchain

#204

Earlier quoted context omitted.

I agree that I hate this solution. However, are you saying that this is a bad FizzBuzz solution to you? (Python) nums = list(range(100)) def fizzbuzz(n): if n % 15 == 0: return "FizzBuzz" elif n % 3 == 0: return "Fizz" elif n % 5 == 0: return "Buzz" else: return str(n) print(" ".join(map(fizzbuzz, nums))) I think it's far better than: nums = list(range(100)) for num in nums: if num % 3 == 0: print("Fizz", end="") if…

I don’t want to argue in favour of the Beads solution but I think the right way to describe the logic is as follows: input is n | 3 divides n | 5 divides n | result | |—————————————|—————————————|————————————| | Yes | Yes | “FizzBuzz” | | Yes | No | “Fizz” | | No | Yes | “Buzz” | | No | No | n.toString | print result The key points are: 1. The logic is declarative: the order of the rows in the table doesn’t matter. 2…

I agree, I think that's close to isomorphic to my first solution! There's a "mapping" from numbers to strings, and this is the mapping.

Re: Beads: Computer language and toolchain

#205
post #164

Earlier quoted context omitted.

okay i have rewritten parts of it. I hope you folks take it for a spin; it has a lot of nice touches in it; worked very hard on the balance between concision and readability.

I was amused to see you trash-talking COBOL on your blog, because the language snippets I've seen read a bit like COBOL.

I don't see similarities with COBOL other than Beads has a low percentage of punctuation, but that is from imitating Python's indent-significant code structure style.

COBOL generated a lot of billable hours. I did early years in my career as a consultant-for-hire in a SF body shop, and occasionally would have to fix some COBOL thing. I sure hated it. Woke up one day in a puddle of drool from passing out because of boredom, and then switched jobs.

Beads is from a word-count metric, is probably within 20% of the minimum word count for the sample programs i presented, if you exclude techniques that greatly obfuscate the logic such as those used in Oscar Toledo's famous chess program.

Substitution and concatenative languages like FORTH regularly win code-length contests, but they aren't very readable. Beads tries to find a happy medium between brevity and clarity. I think people writing it will enjoy the careful balance that was struck.

Re: Beads: Computer language and toolchain

#206
post #10

This is their example of Fizzbuzz: https://github.com/magicmouse/beads-examples/blob/master/Exa... But this is supposed to replace Excel somehow? Along with basically every other language. I can't accuse them of not being ambitious.

I'm struggling to see the advantage over currently popular languages.

Compared to HTML/CSS/JS, Beads is much simpler. You can learn Beads in probably under 10 hours, while CSS takes at least 100 hours to master.

Most of the older popular languages like C, C++, Java, have huge external libraries you have to learn to make graphical interactive software.

So for the target application area, which is graphical interactive software, Beads is far simpler, and has many features to avoid error at compile time, and keep running with fault tolerance at execution time.

Re: Beads: Computer language and toolchain

#207
post #131

Earlier quoted context omitted.

Funny you should mention Regular Expressions. In Beads there is a complete rewrite of the syntax for regular expressions, replacing the meta characters with a more readable vertical format that facilitates comments, and offers subroutines. For example, compare the IPv4 address regular expression as done in JS: ``` (\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]){3}| ``` with the Beads notation…

I've got to be honest I can read the regex example even without the comments you added in your example, I can't read the example. "Group or digit" matches 0-9? I dont think it helps that you're missing newlines. Try putting four spaces at the start of every line.

Okay, i didn't know you had to put in spaces in HN comments to get it to format, here is the regular expression in classic Unix style versus Beads style for the IPv4 address (1.2.3.4):

JS style: (\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]){3}

Beads style:

     pattern octet 
     group or
      digit         //  matches 0..9
      set:'1-9' digit   //  matches 10 .. 99
      '1' digit digit   //  matches 100 .. 199
      '2' set:'0-4' digit  //  matches 200 .. 249
      '25' set:'0-5'   //  matches 250 ..255

    pattern IPv4
       octet '.' octet '.' octet '.' octet
As you can see the Beads pattern notation allow subroutines, uses keywords like 'digit' instead of \d, and is far more readable. There are plenty of examples, and the more complex the expression the more favorable the comparison.

Re: Beads: Computer language and toolchain

#208

Earlier quoted context omitted.

I am not aware of any bug in this code. It works, and the selection persists. Of course it is a silly project. Classic FizzBuzz is just too simple a task to show off any language features, so the task was souped up so that it draws a 10x10 grid of the results, and lets you pick one of the 100 cells to highlight. It persists this selection for a day to show how one can save up to 1kb of state information trivially ins…

OP means that the comment says it's persisted for a month, but the actual code persists for a day.

Ah, i see i forgot to update the comment when i changed to one day so i could test it easier... thanks for pointing that out, will correct.

Re: Beads: Computer language and toolchain

#209
post #116

Earlier quoted context omitted.

I am not aware of any bug in this code. It works, and the selection persists. Of course it is a silly project. Classic FizzBuzz is just too simple a task to show off any language features, so the task was souped up so that it draws a 10x10 grid of the results, and lets you pick one of the 100 cells to highlight. It persists this selection for a day to show how one can save up to 1kb of state information trivially ins…

That's neat, but imho start with the plain fizzbuzz first. Everyone has it in their lexicon so it acts as a first-pass Rosetta stone for what the language syntax is like. Adding extra bits implies you need those to get the job done.

I just updated the program to allow arbitrary arrays of words and factors for division, so now it is a fizz-buzz-jazz version of the program, and it gets even shorter once you go to table driven data.

    var ss = ""
    var color = ALICE_BLUE

    loop across:WORDS index:wordx
     if mod(b.cell_seq, PRIMES[wordx]) == 0
      WORDS[wordx] &=> ss
      color = COLORS[wordx]
    if ss == ""
     //  plain cell
     ss = to_str(b.cell_seq)

Re: Beads: Computer language and toolchain

#210

Earlier quoted context omitted.

> Honestly, i think graph db being more powerful is one of their more reasonable claims. Graph db trade off a more flexible data model (which some people would call power) You can represent graphs in the relational model so that’s simply bullshit.

Neo4j had a great demo, load up the IMDB database, then solve six degrees of Kevin Bacon with SQL vs with Cypher. The Cypher is a one liner that runs immediately, the SQL is a mess that almost brings down the database. For certain types of queries, recommendation engines being a prime example, graph databases are awesome.

For one, Neo4j is an implementation and SQL is not. As for clarity, SQL, although by far the most widespread query language is a shitty language in many respects... again a separate issue from the relational model.

In any case you’re conflating a storage engine and a query language. There’s no reason an RDBMS implementation cannot be tuned for graphs, and there is no inherent lack of generality in the relational model which seems to be the prior posters claim. Whether Neo4j is a useful piece of software is a different topic.

Post reply on HN