Live data from Hacker News

Dada, an experimental new programming language

dada-lang.org

331–340 of 428 posts

Re: Dada, an experimental new programming language

#331
post #309

It's a bit frustrating that I have to click around hunting for an example of the syntax. If you are making a new programming language, please do us a favor and put your Hello World syntax example right on the landing page.

I thought the docs themselves were a work of conceptual art i.e. the docs themselves were "dadaist" and were the main point of the site

Re: Dada, an experimental new programming language

#333
post #127

Earlier quoted context omitted.

They borrowed it from Rust: `.await` is special syntax, roughly equivalent to `await print(...)` in other languages. https://rust-lang.github.io/async-book/01_getting_started/04...

I wonder why not do `await print()` though? It reads more naturally as "wait for this" and is more clearly not a property access.

Some more details on `await` as a postfix operator rather than prefix

https://blog.ceejbot.com/posts/postfix-await/

Re: Dada, an experimental new programming language

#334

Earlier quoted context omitted.

Reference counting and locks often is the easy path in Rust. It may not feel like it because of the syntax overhead, but I firmly believe it should be one of the first solutions on the list, not a last resort. People get way too fixed on trying to prove to the borrow checker that something or another is OK, because they feel like they need to make things fast, but it's rare that the overhead is actually relevant.

Yes! Thank you! Dunno what it is about Rust that makes everyone forget what premature optimization is the root of all of.

The zero cost abstraction is so tantalizingly close enough to reach!

I tell everybody to .clone() and (a)rc away and optimize later. But I often struggle to do that myself ;)

Re: Dada, an experimental new programming language

#335
post #92
post #85

Earlier quoted context omitted.

> actually creating a working language is a big overhead Languages, with first class values, pattern matching, rich types, type inference and even fancy RTS, often can be embedded in Haskell. For one example, it is very much possible to embed into Haskell a Rust-like language, even with borrow checking (which is type-checking time environment handling, much like linear logic). See [1], [2] and [3]. [1] http://blog.si…

Are you suggesting that creating a new programming language from scratch is a trivial exercise? If yes, wow. If no, I think the intention of your comment could be more clear, particularly regarding the quote you took from the original comment.

Quite the contrary.

You need to use existing facilities (type checking, pattern matching combinators, etc) of a good implementation language as much as possible before even going to touch yacc or something like that.

Re: Dada, an experimental new programming language

#336

Earlier quoted context omitted.

> If my goal as a programmer is to simply print to the console, why should I add care about the await? Because that isn't ever anyone's actual goal? Optimizing a language design for "Hello World" doesn't seem like a particularly useful decision.

It’s not an end goal, maybe, but if I’m writing a complex program and I want to print to the console for logging or debugging or status, I shouldn’t have to think about the design of that print-call. I would like to be able to focus on the main complexity of the program, rather than worry about boiler-plate complexity every time I want to print.

You seem to be making the assumption that in other languages calling print is a blocking function that guarantees the printing of a string. Which it isn’t.

In python print adds your string to the stdout buffer, which eventually gets written out to the console. But it not guaranteed, if you want that guarantee you need to call flush on the stdout IO handler.

Dada has taken the approach of making blocking IO operations explicit, rather than purely implicit. The result is that if you want to perform an IO operation, you need to explicitly say when you want to block, rather than allowing an elaborate stack of runtime buffers dictate what happens immediately, what happens later, and what going to block further code execution.

In short this completely exists in other languages like Python, you’ve simply not be aware of it, or aware of the nuanced was in which it fails. But if your someone whose wasted hours wrestling with Python IO system, then you’ll appreciate the explicit nature of Dada’s IO system.

Re: Dada, an experimental new programming language

#337

Earlier quoted context omitted.

Yes, that's true - "number" is probably more broad than I'd really want. That said, python's "int", "float" and "decimal" options (although decimal isn't really first class in the same way the otherse are) feels like a nice balance. But again, its interesting the way even that is probably a bias towards the type of problems I work with vs other people who want more specification.

The key though is probably to have a strong Number interface, where the overhead of it being an object is complied away, so you can easily switch out different implementations, optimize to a more concrete time at AOT/JIT time and have clear semantics for conversion when different parts of the system want different concrete numeric types. You can then have any sort of default you want, such as an arbitrary precision l…

That sort of stuff is easy to do with Truffle (which, ironically, lets you define a language using what they call the "truffle dsl").

The SimpleLanguage tutorial language has a bigint style number scheme with efficient optimization:

https://github.com/graalvm/simplelanguage/blob/master/langua...

Re: Dada, an experimental new programming language

#338

Earlier quoted context omitted.

Yes, that's true - "number" is probably more broad than I'd really want. That said, python's "int", "float" and "decimal" options (although decimal isn't really first class in the same way the otherse are) feels like a nice balance. But again, its interesting the way even that is probably a bias towards the type of problems I work with vs other people who want more specification.

"Number" implies at least the reals, which aren't computable so that's right out. Hans Boehm's "Towards an API for the Real Numbers" is interesting and I've been gradually implementing it in Rust, obviously (as I said, they aren't computable) this can't actually address the reals, but it can make a bunch of numbers humans think about far beyond the machine integers, so that's sometimes useful. Python at least has the…

I don't know why you think it implies reals. Most people would assume BigDecimal

Re: Dada, an experimental new programming language

#339
post #64

Earlier quoted context omitted.

A smart print() implementation may check if there's enough output buffer, and, if so, quickly return a Future which has already completed. A smart scheduler can notice that and not switch to another green thread.

One can argue that in the VAST majority of instances, you'll never ever be printing so much that you'll fill the buffer. If you need that kind of control, just get a direct stream to stdout, otherwise make print() block if it needs to.

You might not fill the buffer. But your program might crash before the buffer is flushed. In that case having prints explicitly block until the IO is completed is very valuable, especially when debugging. Nobody wants to waste time debugging their debug code.

Re: Dada, an experimental new programming language

#340

Earlier quoted context omitted.

You might like Kotlin. It'll also give you access to the entire JVM ecosystem.

Is that a blessing or a curse?

A blessing. Do you really want to write all the libraries from scratch for a new language? Do you want to come up with portable abstractions that work well on Windows? (and don't think you can skip that, people will ask).

Most people don't. That's not the fun part of language design.

Post reply on HN