Live data from Hacker News

Dada, an experimental new programming language

dada-lang.org

381–390 of 428 posts

Re: Dada, an experimental new programming language

#381

Earlier quoted context omitted.

> Then why do functions with sync syscalls (ie file, timers or mutex ops) not expose the same contractual differences? They’re just regular functions in most languages including Rust. Because the kernel doesn't expose that contract, so they don't have that behaviour. > The only difference is whether the runtime sits in the kernel or in user space. In other words, what contracts you have control over and are allowed t…

>>[mutexes] are just regular functions in most languages including Rust. >Because the kernel doesn't expose that contract, so they don't have that behaviour Which OS are we talking about? Linux doesn't really have mutices as primitives. You can build async mutexes on top of eventfd and soon even on top of futexes with io_uring.

I’m on mobile so it’s tough to look up the details, but IIRC at least Windows?

Implementations of the standard library mutexes are here https://github.com/rust-lang/rust/tree/master/library/std/sr...

And of course it’s pthreads on Linux.

Re: Dada, an experimental new programming language

#382

Earlier quoted context omitted.

Would waiting on a mutex or signaling a semaphore require explicit awaiting in Dada? What about faulting in an mmaped memory buffer?

I honestly don’t understand why you seem to be getting so upset about this. Dada isn’t a real language, it’s a thought experiment. It’s whole purpose to ask exactly these questions, and discuss the consequences, so those learnings can be used to inform other languages. Arguing that a particular design choice is silly from a purely ergonomic or usage perspective is kind of absurd, given you literally can’t use the lan…

Sorry for appearing that way, I'm genuinely not getting upset. I'm just passionate about this relatively minor corner of language design.

Exactly because Dada is just a thought experiment it interesting to push the boundaries of such a model in various ways with low stakes.

Constructively, I'm partial to full coroutine abstractions that hide the asynchronouness of functions or on the other side of the spectrum, to full effect systems.

I think async is a necessary evil on some high performance languages (like rust, C++, certainly not python), but elevating it to an actually desirable from the ergonomic point of view seems just wrong.

Re: Dada, an experimental new programming language

#383
post #352

Earlier quoted context omitted.

In my view you have compared it to the only other language for which it is small by comparison :) But different strokes for different folks! I have nothing against Scala, its multi-paradigm thing is cool and impressive, it just isn't for me except by way of curiosity.

Could you list all the features you are thinking of?

I think all the links in the first two sections in the What Is Scala[0] docs give the flavor pretty well. It contains a full (and not small) set of OO language functionality, alongside an even more full-featured functional language.

There are a lot of adjectives you can use to describe Scala - mostly good ones! - but "small" just isn't one of them.

0: https://docs.scala-lang.org/tour/tour-of-scala.html#what-is-...

Re: Dada, an experimental new programming language

#384

Earlier quoted context omitted.

For Arc/Rc? I don't recall that! What was it? I recall it being `&borrowed`, `~boxed`, `@garbage_collected`. Aaaah, I'm realizing in typing this that the `@foo` syntax was actually implemented via reference counting? I think my intuition at the time was that the intention was for those to eventually be backed by a mark-and-sweep GC, which I did think was a poor fit for the rest of the language. But as just a syntax f…

Yes, I’m referring to @foo, which IIRC maybe in the VERY old days had a GC but from when I got involved in 2012 was reference counting, iirc. Regardless of the specifics here, the same problems apply. Namely that it privileges specific implementations, and makes allocation part of the language.

Yeah, which circles back to the thread-starter's comment. My thought-experimental different version of rust would not mind shipping with a privileged implementation of garbage collection, or having allocation be part of the language.

It wouldn't be a good fit for projects like the ones at Oxide :) I'm very glad Rust itself exists, with good support for use cases like those!

Re: Dada, an experimental new programming language

#385
post #355

Earlier quoted context omitted.

Honestly, I think syntax for Arc (and/or Rc or some generalization of the two) and more "cultural" support for writing in that style would have benefitted rust back when 1.0 was being finalized. But I think the cow is out of the barn now on what rust "is" and that it isn't this.

@gc references were Arc under the hood!

Totally makes sense! Not sure if I never knew or if that knowledge got lost in the sands of the past decade (or more, I think?) of time.

Re: Dada, an experimental new programming language

#386

Earlier quoted context omitted.

IMO the main thing that made Pascal verbose is begin...end for all compound statements. If you ditch that - as even Wirth himself did in the next iteration, Modula-2 - the rest is much more palatable. Consider: (* Pascal *) if a > b then begin blah; blah; end else begin blah; blah; end; -- Ada if a > b then blah; blah; else blah; blah; end if; // C if (a > b) { blah(); blah(); } else { blah(); blah(); } Pascal is cle…

{} are isomorphic to 'begin' and 'end' in that snippet, though. Part of the reason why early programming languages were comparatively heavy on keywords is that the symbol set was not standardized across machines, so you couldn't count on some symbols being available. It's why C still supports as digraphs for curly braces, or for square brackets. Also why languages such as COBOL go as far as supporting syntax like DIV…

They are, but it makes all the difference in practice. You can write "then begin" and "end else begin", but I haven't ever seen Pascal code written in that style, and I can understand why - it's just much less readable.

OCaml is nice in that "begin" and "end" are aliases for "(" and ")", so you can use whichever one makes the most sense for readability.

Anyway, the point is that the way to go is either 1) make structured programming constructs implicitly compound, so that you don't need braces for multi-statement bodies, or 2) make those braces as compact as possible so that being explicit is not so painful.

Re: Dada, an experimental new programming language

#387

Earlier quoted context omitted.

It is interesting to consider how much the lower abstraction influences the higher abstraction. If you are building on a existing language/runtime/framework then you can inherit more functionality and move faster, but also you implicitly will inherent many of the design decisions and tradeoffs.

totally. for me the interplay between the host language and the target language is hardest thing for me to manage when bringing up a new environment. it really doesn't seem like it should be a big deal, but it comes down to the sad reality that we operate by rote alot of the time, and completely switching semantic modes when going between one world and the other is confusing and imposes a real cost. I'm still not tha…

You can have target language to be as far fom host language as you like.

For one example, again, borrowed fom Haskell universe, is Atom [1]. It is a embedded language to design control programs for hard real-time systems, something that is as far from Haskell area of application as... I don't know, Sun and Pluto?

[1] https://hackage.haskell.org/package/atom-1.0.13

Re: Dada, an experimental new programming language

#388
post #220

Earlier quoted context omitted.

So in python, you need to understand not 1, but at least 3 different versions of “an entry point”, and to you, this is “less cognitive load”? I had the same issue with Swift. There’s 30 ways to write the exact same line of code, all created by various levels of syntax sugar. Very annoying to read, and even more annoying because engaging different levels of sugar can engage different rulesets.

You don't "need" any of the entry points when you are beginning Python. print("Hello World") is a perfectly valid and runnable Python code. And when you are working on a small part of a large code base, you usually don't care about __main__ either. So yes, it's complexity but it's complexity that you don't need to encounter right away. Python is intuitive off the bat. public static void main(String[] args) is not.

FWIW, in an upcoming version of Java you'll likely be able to do this:

    $ cat Hello.java
    void main() { System.out.println("Hello, world!"); }
    $ java --enable-preview --source 21 Hello.java 2>/dev/null
    Hello, world!
    $
This is currently a preview feature in Java 21 and 22.

Re: Dada, an experimental new programming language

#389
post #387

Earlier quoted context omitted.

totally. for me the interplay between the host language and the target language is hardest thing for me to manage when bringing up a new environment. it really doesn't seem like it should be a big deal, but it comes down to the sad reality that we operate by rote alot of the time, and completely switching semantic modes when going between one world and the other is confusing and imposes a real cost. I'm still not tha…

You can have target language to be as far fom host language as you like. For one example, again, borrowed fom Haskell universe, is Atom [1]. It is a embedded language to design control programs for hard real-time systems, something that is as far from Haskell area of application as... I don't know, Sun and Pluto? [1] https://hackage.haskell.org/package/atom-1.0.13

I'm sorry - of course you can. my problem is that switching back and forth I internally get them confused. and I start moving the target language to be closer to the host. while this might be my failing alone, I've seen this happen quite a bit in other language design projects.

Re: Dada, an experimental new programming language

#390

Earlier quoted context omitted.

In college, my programming languages class used a language called "Mystery" (I believe created by my professor), which was configurable . Assignments would be like "write some test programs to figure out whether the language is configured to use pass-by-value or pass-by-reference". And there were a bunch of other knobs that could be turned, and in each case, the idea was that we could figure out the knob's setting by…

Don't be so quick to discount DSLs. Sure, you don't want a half-baked DSL when some simple imperative code would do. But if you watch your API evolve into an algebra and then don't formalize it with a DSL you might be leaving powerful tools for understanding on the table. A poor-fitting language is terrible for abstract thinking, on the other hand an internally-consistent and domain appropriate language can unlock ne…

amen to this … i recommend thinking about your problem in terms of effective data structures and then apply even a very simple DSL to handle access and transformations … fwiw the built in Grammars and Slang support in raku https://docs.raku.org are fantastic tools for this job.
Post reply on HN