Live data from Hacker News

Beads: Computer language and toolchain

beadslang.org

91–100 of 235 posts

Re: Beads: Computer language and toolchain

#92

It seems that after years of trying to develop programming languages and architectures to have separation of concerns, with the business logic, the presentation logic, and the data storage separated (or even going to full-blown microservices), this just... bunches everything together? I get the appeal for a small program that fits in your head, but for anything more complex I don't want the code to take care of every…

The original promise of separation of concerns wasn't simply a code organization scheme, it was that we would be able to write composable software where components could be added or replaced with minimal systemic impact. We were going to be able to drop in new UIs without touching the BL or fix a bug in a component in one place and have it fixed everywhere, etc. The problem was that SoC, and the other various concepts from SOLID and design patterns didn't quite accomplish that - inter-dependencies remained and only became more difficult to reason about. Chasing this fantasy led object oriented programming down a path of increasingly complicated frameworks to try to manage and hide these dependencies until one would find themself thinking more about program structure and writing more plumbing code than doing actual work. Worse, now you have all the bits of logic necessary to understand how something works spread across multiple files so you have to have a system-wide understanding of a systems organization and understand the workings and vagaries of the half dozen or so different frameworks that were used to make it all seem magically loose-coupled. I'm sure there's some 's Law somewhere that states it better, but it boils down to the fact that for any given set of tasks you can only reduce the complexity so much and anything else is just moving the complexity around, not eliminating it. I think there's something to be said for having all the logic you need to understand an interface in one or two files and focusing on making that as clean as possible, which is exactly what (at least some) of the 4GLs in the past seemed to do well, or at least made possible.

Re: Beads: Computer language and toolchain

#93
post #48

- promises far fewer bugs - promises to replace entire stack - ...and Excel - "declarative languages have almost no bugs" - built-in database Yeah color me skeptical. I love experiments, but I prefer those that under-promise and over-deliver. People have been promising unification languages since there were only two languages. People have been promising cross-platform since there were two platforms. And people have b…

The thing that really bothered me was the FizzBuzz example [0]. The core logic is: cell // this routine will be called 100 times, and the implied block variable // b will hold values, like the sequence number b.cell_seq var ss : str case mod(b.cell_seq, 15) | 0 ss = "FizzBuzz" draw_rect(fill:LIGHT_SKY_BLUE) | 3, 6, 9, 12 ss = "Fizz" draw_rect(fill:LIGHT_GREEN) | 5, 10 ss = "Buzz" draw_rect(fill:YELLOW) else ss = to_s…

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 num % 5 == 0:
      print("Buzz", end="")
    if num % 3 != 0 and num % 5 != 0:
      print(num, end="")
    print(" ")
EDIT: Formatting, typo

Re: Beads: Computer language and toolchain

#94
post #81

Earlier quoted context omitted.

The thing that really bothered me was the FizzBuzz example [0]. The core logic is: cell // this routine will be called 100 times, and the implied block variable // b will hold values, like the sequence number b.cell_seq var ss : str case mod(b.cell_seq, 15) | 0 ss = "FizzBuzz" draw_rect(fill:LIGHT_SKY_BLUE) | 3, 6, 9, 12 ss = "Fizz" draw_rect(fill:LIGHT_GREEN) | 5, 10 ss = "Buzz" draw_rect(fill:YELLOW) else ss = to_s…

I don't understand your objection.

I think he's saying that inside of the loop in FizzBuzz, it should look like something like this (Python-esque pseudocode, assuming for a second print() doesn't add a newline automatically):

    if x % 3 == 0:
        print("Fizz")

    if x % 5 == 0:
        print("Buzz")

    if x % 3 != 0 and x % 5 != 0:
        print(x)

    print("\n")
i.e. no special "FizzBuzz" case for when it's divisible by 15, it just naturally falls out of the first two if's. It's a bit of a silly objection though, the it's fine to write it as the author did.

Re: Beads: Computer language and toolchain

#95
post #9

It looks like a functional(ish) reactive programming language, with an embedded database, and an SDK for compiling to JS and cross-platform binaries. Do I have that right?

Beads follows the State-Action-Model pattern, as described at sam.js.org. It is derived from the TLA+ work of Lamport. You have a mutable state, with pure code that renders the state on the screen, and then event tracking code mutates the state. What makes Beads unusual is that when you change the model, the screen layout section affected is automatically scheduled for refresh. This is possible because the state is being tracked

Re: Beads: Computer language and toolchain

#96

It seems that after years of trying to develop programming languages and architectures to have separation of concerns, with the business logic, the presentation logic, and the data storage separated (or even going to full-blown microservices), this just... bunches everything together? I get the appeal for a small program that fits in your head, but for anything more complex I don't want the code to take care of every…

Beads uses the proven MODULE system of Modula-2 and Oberon. Of course we don't expect people to write in one single file. That the examples are small programs does not reflect the modular design of the language.

The entire purpose of the project is to build a world of software constructed by interchangeable parts. But to accomplish interchangeable parts, one has to make sure that there are as few external dependencies as possible, which is why the language has layout, drawing, event tracking, and database features pulled into the language, so as to not have one reaching outside, which would invariably break over time.

C proved that a standard library was a major feature of any language, and Beads has a well designed, but compact standard library, where you have a few functions, with lots of options so as to reduce the total number of functions one has to learn.

Re: Beads: Computer language and toolchain

#97
post #91
post #33

Beads is an excellent language I feel, but the killer feature in the works is being able to travel "back" in time

Is this like a time-travelling debugger like rr[0]? 0. https://rr-project.org/

Beads is a tracked mutable state language. It used the State-Action-Model pattern (see sam.js.org), and is built from the start to support time travel debugging. Unlike `rr` and its sequel `pernosco`, it is not an instruction level reversibility, but a state change stepwise reversibility, which is efficient enough to stick around and be used in production use (not just in the lab).

There is a "blackbox_write' and 'blackbox_send" feature, which allows you to send session information sufficient to replay the user's session for debugging purposes.

This is a very powerful feature, and one that we are seeing more and more efforts to offer, because in a world with so many computers, being able to reproduce rarely occurring, data-dependent bugs, is very important.

Re: Beads: Computer language and toolchain

#98
This is kind of a cool project, and I have no doubt it is a good language for the type of programming the author surely does.

However, the design of the language feels like it's a imperative language with a few a few additional features (declarative solver) bolted on to facilitate sub-problems within its use case: well within the paradigm, but lacking real coherent design, or an innovation that would merit non-trivial adoption.

That said, I would be interested at pursuing the source code: it's an interesting hobby language.

Re: Beads: Computer language and toolchain

#99

their loop syntax looks a bit crazy... [0]. [0] http://www.beadslang.com/downloads/refcard.pdf

The loop syntax may appear unfamiliar, but since the core data structure of Beads is not lists, tuples, arrays, but instead a tree, there are various options that are more familiar to Lisp programmers, such as depth-first, or breadth-first tree traversal, but expressed as a loop, so you can conveniently stop it.

Most of the time one will use a loop in a very simplistic manner. Because it is so tedious and common to need the count of the loop, the key value, or a pointer to the element being looped across, we give you implied declaration capability in the loop consruct.

It is a compact notation that has gone through many polishing steps, and is very ergonomic, easy to read, and downright handy. Loops are the bread and butter of computer software, and yes, there are a fair number of options (such as going in reverse).

Please take the language for a spin, you might like it.

Post reply on HN