News for hackers. Stuff that matters.
Re:Deno in 2023 by ogoffart on Monday February 05, 2024 @06:46AM (#39260175)
I'm interrested in the WebGPU feature.

With Slint [1] we're working on a framework which allow to make a desktop GUI in Javascript/Typescript, without bringing a browser/webview. Currently, we do it by using binaries through napi-rs so we can bring in a window using the platform native API. And then we do some hack to merge the event loops.

But if Deno supports bringing up a window directly, this means we can just ship wasm instead of native binary for all platform. And also I hope event loop integration will be simplified.

Although we'd also need more API than just showing a window (mouse and keyboard input, accessibility, popup window, system tray, ...)

[1] https://slint.dev

Edit: I got excited a bit too early. The WebGPU feature doesn't include the API to launch a Window. One still need to rely on an extra library binary.

Re:Deno in 2023 by FrostKiwi on Monday February 05, 2024 @08:39AM (#39261082)
Big fan of custom rendering approaches, but wouldn't such a Design system sidestep any and accessibility tools? Nothing for screenreader to hook into. Text and interfaces would be neither native nor DOM based.
Re:Deno in 2023 by pygy_ on Monday February 05, 2024 @10:52AM (#39262422)
Slint uses https://github.com/AccessKit/accesskit to provide cross-platform a11y.
Re:Deno in 2023 by landr0id on Monday February 05, 2024 @03:53PM (#39267003)
> a11y

I apologize for this being so besides the point of your post, but I hate this trend so much.

Re:Deno in 2023 by pests on Monday February 05, 2024 @04:05PM (#39267161)
It has to be going on at least a decade right? Is it really a trend?
Re:Deno in 2023 by landr0id on Monday February 05, 2024 @04:19PM (#39267344)
i18n has been around for ever and makes sense since in code it’s a bit long. Then k8s, which never made sense to me. I don’t know if it’s appropriate to call it a trend, but I’ve seen people doing it more frequently.

The irony with this example is people with screen readers will hear something like “aEleveny” and it looks like “ally”.

Re:Deno in 2023 by refulgentis on Monday February 05, 2024 @04:35PM (#39267556)
People with screen readers are aware of acronyms even if they have poor vision, and it's unclear to me what the problem is, a11y has been around forever and in code it's a bit long.

Reading again, is the trend you detest...abbreviations that have a number representing letter count? Based on the existence of k8s and a11y?

Re:Deno in 2023 by landr0id on Monday February 05, 2024 @04:42PM (#39267648)
I’m just stating my opinion that I find these abbreviations annoying, yes. They are so unintuitive that unless someone explicitly calls out what it’s abbreviating, you probably wouldn’t pick up on it (e.g. the MDN page for Accessibility) and just leaves people confused (like me!). I suspect there’s a reason AccessKit isn’t named `a11yKit`
Re:Deno in 2023 by pests on Monday February 05, 2024 @04:46PM (#39267691)
Aren't a lot of abbreviations unintuitive until you learn what they mean?

Didn't we just have a thread the other day about the meaning of "MDN" - which also many people didn't know.

I see on this site "IMO" "FWIW" "IANAL" "TLDR" all the time. You generally can't tell what these mean either without looking them up or just knowing already because of them being so engrained in culture.

Re:Deno in 2023 by archerx on Tuesday February 06, 2024 @12:54AM (#39271246)
No it’s not the same, a11y creates a dissonance in the mind because part if it wants to see it as “ally”, the other part wants to see it as “A eleven Y” and the other part cringes and thinks its stupid.
Re:Deno in 2023 by pests on Tuesday February 06, 2024 @04:24PM (#39280847)
If you can't tell a 1 apart from an L...
Re:Deno in 2023 by archerx on Wednesday February 07, 2024 @10:55AM (#39290045)
Thats not the point, but what about people that have vision impairments? Isnt the whole point about accessibility?
Re:Deno in 2023 by pokle on Monday February 05, 2024 @06:46PM (#39268792)
Hypocritically 'a11y' isn't very accessible for those of us who don't use the jargon.

Also, the first thing the project website (https://www.a11yproject.com) has to do is explain what the '11' stands for. So they must have some awareness of how inaccessible their name is.

Re:Deno in 2023 by archerx on Tuesday February 06, 2024 @12:51AM (#39271228)
Yes it’s awful, “A eleven Y” or is it “A one one Y” Is stupid, inaccessible and the people who use it and came up with it should feel bad.
Re:Deno in 2023 by NoobSaibot135 on Tuesday February 06, 2024 @12:58PM (#39277852)
a11y is similar to Andreessen Horowitz => a16z in that there’s exactly 16 letters in between the first letter and the last.

Seems like good acronym semantics no?

Re:Deno in 2023 by CyberDildonics on Tuesday February 06, 2024 @04:02PM (#39280547)
That's not what semantics or acronym mean, this is more of an inside joke, which isn't great.
Re:Deno in 2023 by CyberDildonics on Monday February 05, 2024 @09:35AM (#39261612)
This doesn't really seem related, it seems like you're saying "maybe we will use this, here is a link to our commercial GUI library".

Also why would you want to make a GUI even more bloated by integrating a browser to get webgpu and webasm (and why webgpu instead of just webGL?). That might be easy for library makers but why would someone want a giant library to make a GUI when they already have electron if they don't care about 350MB binaries to pop up a window.

Re:Deno in 2023 by themerone on Monday February 05, 2024 @10:30AM (#39262191)
They are talking about using webgpu for rendering to screen without going through a browser.

Webgpu and wasm without a web browser would be a nice way to distribute portable sandboxed code.

The reason for Webgpu is that it it has semantics closer to modern modern apis like Metal or Direct X.

Re:Deno in 2023 by CyberDildonics on Monday February 05, 2024 @12:03PM (#39263494)
What does it have to do with Deno and why do any of that to draw boxes and text on the screen? FLTK could do GUIs that took almost no CPU power starting with 100KB binaries 30 years ago.

People doing hardware accelerated GUIs have been using openGL for almost as long. This doesn't need to be a science project or a rabbit hole, drawing a GUI quickly is well worn territory.

Re:Deno in 2023 by dwmbt on Monday February 05, 2024 @12:32PM (#39263886)
edit: i will not be taking this comment in good faith, i had a look through parents comments and it looks like they simply do not agree with Slint's approach to GUI programming: https://news.ycombinator.com/item?id=39223499#39229382

> What does it have to do with Deno

can we at least try to give people the benefit of the doubt instead of pretending like everyone is out to get you? if you read the change-log, it spells it out well:

> Our goal is to provide a windowing solution for WebGPU without linking to native windowing systems like X11

> This is a low level API that can be used by FFI windowing libraries like sdl2, glfw, raylib, winit and more to create a WebGPU surface using native window and display handles.

do you get it yet?

> People doing hardware accelerated GUIs have been using openGL for almost as long. This doesn't need to be a science project or a rabbit hole, drawing a GUI quickly is well worn territory.

i suggest talking to other graphics professionals to get a better understanding of why opengl is not _the_ solution. for a tldr[0]:

> regular OpenGL on desktops had Problems. So the browser people eventually realized that if you wanted to ship an OpenGL compatibility layer on Windows, it was actually easier to write an OpenGL emulator in DirectX than it was to use OpenGL directly and have to negotiate the various incompatibilities between OpenGL implementations of different video card drivers. The browser people also realized that if slight compatibility differences between different OpenGL drivers was hell, slight incompatibility differences between four different browsers times three OSes times different graphics card drivers would be the worst thing ever. From what I can only assume was desperation, the most successful example I've ever seen of true cross-company open source collaboration emerged: ANGLE, a BSD-licensed OpenGL emulator originally written by Google but with honest-to-goodness contributions from both Firefox and Apple, which is used for WebGL support in literally every web browser.

also, openGL is deprecated on macOS.

[0]: https://cohost.org/mcc/post/1406157-i-want-to-talk-about-web...

Re:Deno in 2023 by CyberDildonics on Monday February 05, 2024 @01:07PM (#39264437)
it looks like they simply do not agree with Slint's approach to GUI programming

My comment here is explaining exactly why I don't agree, no digging required.

Your quote is also about browsers implementing the webGL API, it has nothing to do with using basic openGL for GUIs, which again, is not required, because CPUs have been rendering GUIs for decades.

Re:Deno in 2023 by ogoffart on Monday February 05, 2024 @01:02PM (#39264361)
FLTK and other libraries cannot be used from JavaScript.

JavaScript is one of the most popular programming language. But a JavaScript dev who needs to make a desktop GUI will usually need to use Electron to bring up a browser for the GUI. This means actually two JavaScript engine (Node and Chromium)

The reason it has to do with Deno is that you need a JavaScript/TypeScript runtime. But you may not need a browser. So you can develop your application in JavaScript using a framework that doesn't use the DOM but show a native window instead.

This is more lightweight and more secure (no risks of HTML injection and the browser is a big attack vector)

Re:Deno in 2023 by themerone on Monday February 05, 2024 @01:15PM (#39264580)
FLTK is permanently stuck in the 90s. It doesn't have full unicode support, right-to-left & bidirectional text, and doesn't support accessibility tools.

Not to mention that development has been stagnant for 15 years since it's flagship application (Nuke), was ported to QT.

Re:Deno in 2023 by moal on Monday February 05, 2024 @06:05PM (#39268457)
Actually FLTK has full unicode support, right-to-left and bidi text. The limiting factor is the OS. For rtl and bidi, it depends on the OS. On linux for example, if FLTK is built with pango support, it'll support them just fine. On windows and macos, these work out of the box. As for accessibility, the only thing missing is screen reader support. Otherwise tab navigation, ime and other modalities are supported. FLTK's bindings in Rust provide an accesskit adapter which supports screen readers using the accesskit crate.
Re:Deno in 2023 by yellowapple on Tuesday February 06, 2024 @12:34AM (#39271134)
> FLTK and other libraries cannot be used from JavaScript.

What's the obstacle to using it via FFI (which Deno seems to support)?

Re:Deno in 2023 by ogoffart on Tuesday February 06, 2024 @02:08AM (#39271635)
Someone has to first write bindings to the library using said FFI. This is not something most JavaScript dev can do. This has to be written by someone who knows C++ and JavaScript, and be good at both to understand all the details. (How the two interacts, how the lifetime of C++ objects play with the garbage collector, how do the inventloop mixes, ...) Writing such binding is a huge work as they the whole API need to be wrapped. And sometimes concept from the one language don't map easily in the other. (eg. templates)

And then you still have to ship an extra binary in addition to Deno itself.

Re:Deno in 2023 by yellowapple on Tuesday February 06, 2024 @10:31PM (#39284127)
Right, but that's still a far cry from being entirely unable to use them together. And as for the extra binary, that's hardly an obstacle if you already have to ship Deno itself anyway (and that ain't even considering the possibility of statically-linking it into a custom Deno binary).
Re:Deno in 2023 by pjmlp on Tuesday February 06, 2024 @04:03AM (#39272373)
Alternatively, they could maybe, just maybe, learn another programming language, but that is asking too much in today's culture it seems.
Re:Deno in 2023 by wiseowise on Tuesday February 06, 2024 @10:34PM (#39284150)
Nothing screams efficient use of time like learning programming languages for every little thing.
Re:Deno in 2023 by pjmlp on Wednesday February 07, 2024 @02:48AM (#39285731)
It isn't harder than learning new JavaScript frameworks every month.
Re:Deno in 2023 by wiseowise on Wednesday February 07, 2024 @05:18PM (#39295066)
Haha, JS framework meme.
Re:Deno in 2023 by user3939382 on Monday February 05, 2024 @10:11AM (#39262007)
I totally get the idea of bringing JS into new environments because it is so ubiquitous. On the other hand, I hate the language and wish we could replace it in the browser, the opposite direction. I'd be much happier with ClojureScript or PureScript or something being the standard with the ecosystem to go with it.
Re:Deno in 2023 by kybishop on Monday February 05, 2024 @10:26AM (#39262173)
Typescript takes away a significant amount of the pain for me; the only hold up after that was getting an environment set up to compile it. Deno supporting typescript without any configuration is incredible.
Re:Deno in 2023 by int_19h on Wednesday February 07, 2024 @06:22PM (#39295683)
TypeScript is mostly additive, so all the footguns are still there if you aren't careful to avoid them. It also doesn't do anything about the extremely meager standard library that is inferior to what other mainstream PLs had 20+ years ago.
Re:Deno in 2023 by tracker1 on Monday February 05, 2024 @03:09PM (#39266425)
So use WASM with the language of your choice and best of luck to you with that.
Re:Deno in 2023 by user3939382 on Monday February 05, 2024 @03:58PM (#39267073)
That's why I mentioned ecosystem, it's not just about syntax.
Re:Deno in 2023 by crowlKats on Monday February 05, 2024 @11:21AM (#39262874)
it actually does: its not part of the WebGPU API directly itself, but its separate: https://deno.com/blog/v1.40#webgpu-windowing--bring-your-own...
Re:Deno in 2023 by tmiku on Monday February 05, 2024 @12:29PM (#39263839)
I poked around your website because I was curious if the name was a band reference. Love the Spiderland photo of the staff!
Re:Deno in 2023 by PoignardAzur on Monday February 05, 2024 @02:49PM (#39266118)
Have you talked to the Dioxus people recently?

They're working on a project called Dioxus Blitz; from what I'm told, they're trying to implement a minimal browser target, that provides some basic DOM-like features and renders with wgpu.

It's not exactly what you're hoping for, but you might find common ground.

https://github.com/DioxusLabs/blitz

(Also, the Linebender project is working on Masonry, with FFI as a medium-term goal.)

Re:Deno in 2023 by jkelleyrtp on Monday February 05, 2024 @03:06PM (#39266378)
Our v2 of blitz is using firefox itself to resolve CSS and google's advanced WGPU renderer for high-speed text and vector graphics.

https://github.com/jkelleyrtp/stylo-dioxus