News for hackers. Stuff that matters.
Re:Wasp: WASM Programming Language by ModernMech on Friday November 05, 2021 @09:11AM (#29118696)
Seems there’s a name collision, as I thought of this project when I read “Wasp programming language”: https://github.com/wasp-lang/wasp
Re:Wasp: WASM Programming Language by tuddman on Friday November 05, 2021 @10:59AM (#29120221)
and iota: https://github.com/iotaledger/wasp which while not a DSL, also compiles to WASM
Re:Wasp: WASM Programming Language by p4bl0 on Friday November 05, 2021 @09:24AM (#29118844)
The optional parentheses makes the syntax quite ambiguous.

    fibonacci it - 1 + fibonacci it - 2
I'm only hoping to understand what we have here because I already know what Fibonacci is.
Re:Wasp: WASM Programming Language by TheMatten on Friday November 05, 2021 @09:39AM (#29119045)
This really just seems to be ML-style syntax - which is not ambiguous at all, it's just different from C-like languages (functions applied one argument at a time, with function application (empty space) having the biggest precendece)
Re:Wasp: WASM Programming Language by postalrat on Friday November 05, 2021 @10:10AM (#29119485)
Is it one of these?

  fibonacci (it) - 1 + fibonacci (it) - 2
  fibonacci (it - 1) + fibonacci (it - 2)
  fibonacci (it - 1 + fibonacci (it - 2))
Re:Wasp: WASM Programming Language by marcosdumay on Friday November 05, 2021 @10:48AM (#29120056)
On any sane ML-style language, it would be this:

    (fibonacci it) - 1 + (fibonacci it) - 2
But I guess it isn't the case here, because that code doesn't make sense.
Re:Wasp: WASM Programming Language by heinrich5991 on Friday November 05, 2021 @09:49AM (#29119177)
In this case (and if it were interpreted as Haskell syntax), the above term would be wrong.
Re:Wasp: WASM Programming Language by tantalor on Friday November 05, 2021 @11:01AM (#29120239)
The actual example in the readme is unambiguous:

   fibonacci(number - 1) + fibonacci it - 2
Re:Wasp: WASM Programming Language by PotatoPancakes on Friday November 05, 2021 @09:16AM (#29118755)
I love the idea of having everything in one language; dealing with just one thing instead of HTML, CSS, and JavaScript.

But isn't that why everyone moved over to React, Angular, and Vue? It's nice that this is in WASM but honestly, I think I prefer React components written in TypeScript, and you can probably get that compiling to WASM with AssemblyScript.

My two cents: this is a super neat hobby project! Probably won't ever make it to production anywhere though.

Re:Wasp: WASM Programming Language by emteycz on Friday November 05, 2021 @12:35PM (#29121610)
No, JSX in AssemblyScript with the same dev experience is very far away.

AssemblyScript is awesome, but right now it's more similar to C (with TS syntax) - it's not a TypeScript runtime on Wasm, it's a lowlevel language that looks nearly the same, that hopes to integrate Wasm GC etc when it comes (not yet).

Re:Wasp: WASM Programming Language by eyelidlessness on Friday November 05, 2021 @01:16PM (#29122125)
Static TypeScript is much closer to regular TypeScript. But it doesn’t support JSX either (and I while it might make sense with a custom pragma it certainly wouldn’t make sense with React as a default).
Re:Wasp: WASM Programming Language by beepbooptheory on Friday November 05, 2021 @07:37PM (#29125874)
That's ultimately why I couldn't move forward in it. My brain just kept thinking typescript and it was hard to manage the cognitive dissonance of it being identical syntax but with invisible limitations I wasn't used to.
Re:Wasp: WASM Programming Language by cjohnson318 on Friday November 05, 2021 @02:26PM (#29123003)
I'm not sure how wasp and angle interact. It looks like angle uses wasp, so is angle the important thing here? Or is wasp a standalone thing?
Re:Wasp: WASM Programming Language by l30n4da5 on Friday November 05, 2021 @09:41AM (#29119060)
My thoughts -- why does everyone have to come up with some new, _novel_ way of writing html?

Looks like all the examples of wasp are just declarative objects and/or html, so not sure what wasp can do just from looking at those.

Re:Wasp: WASM Programming Language by danielvaughn on Friday November 05, 2021 @12:48PM (#29121782)
For me it's about the fact that html was designed for documents with minimal interactivity, and while it's possible to represent a highly interactive application in html, it poses several significant headaches for developers.

I don't know the right solution, but it's clear that what we have right now doesn't suit our needs and make web development far costlier than it otherwise could be.

Re:Wasp: WASM Programming Language by harryvederci on Friday November 05, 2021 @12:41PM (#29121682)
Indeed. We all know hiccup[0] style is the one true way to do it.

[0] https://github.com/weavejester/hiccup

Re:Wasp: WASM Programming Language by Apofis on Friday November 05, 2021 @03:42PM (#29123900)
Could've sworn we just did this: https://news.ycombinator.com/item?id=29093482
Re:Wasp: WASM Programming Language by jedisct1 on Friday November 05, 2021 @10:17AM (#29119596)
Especially when it doesn't seem to bring anything over haml and pug.
Re:Wasp: WASM Programming Language by trutannus on Friday November 05, 2021 @10:35AM (#29119853)
The most concise and precise way to write a language is generally in the language itself too.
Re:Wasp: WASM Programming Language by jedisct1 on Friday November 05, 2021 @10:51AM (#29120108)
Doesn't really apply to HTML.

Using indentation instead of XML-like opening and closing tags is way more concise, and encodes exactly the same information.

Re:Wasp: WASM Programming Language by zamadatix on Friday November 05, 2021 @12:01PM (#29121141)
It's shorter, I don't know about concise though I suppose that's a subjective point anyways. While it's generally exactly the same there are some corner cases involving formatting rather than structure tags where it's not always 1:1.