News for hackers. Stuff that matters.
Re:Minimum Viable Declarative GUI in C++ by codemonkey-zeta on Wednesday March 23, 2022 @10:59AM (#30779139)
Always fun to see people rediscover Greenspun's 10th rule...

Hmm specifying my UI in code is tedious, and porting it to a different framework is impossible! I wonder if I could encode this somehow...

Eureka! I can just specify my code as a data structure! Now it's implementation agnostic!

How can I actually use it though?

I know! All I have to do is write some functions which recursively descend through the UI data structure and make the corresponding calls to the UI framework!

[Writes an interpreter(s) for their data structure]

Congratulations, now you understand the value prop of lisp, and have a poor supplement in C++.

Re:Minimum Viable Declarative GUI in C++ by jcelerier on Wednesday March 23, 2022 @12:57PM (#30780578)
oh, but I'd definitely use lisp ! If it had static types, easy simd support, complete Qt integration, value types and mandatory unboxed primitives, if it was possible to define non-trivial compile-time assertions and type checks (though maybe some LISP dialects can ? are there statically-typed lisps with the ability for arbitrary type computations ?), if normal programs with normal libraries in the LISP ecosystems could be entirely written without a GC, etc etc... and I'm sure I'm forgetting the other half of the absolute bare minimum of my requirements for the programming languages I use for my day-to-day tasks.

Saying that parsing an AST is on its own a justification for using LISP, is very much like saying that one should use smalltalk or erlang instead of $LANGUAGE every time they implement a message-passing system: at best worth of a shrug. There's a reason why all the projects listed here: https://github.com/celtera/avendish#future-directions are C++ :)

Re:Minimum Viable Declarative GUI in C++ by mbrodersen on Wednesday March 23, 2022 @09:50PM (#30785651)
Absolutely! The same way that Lisp is a poor substitute for C and C++. All languages/systems/libraries/frameworks have things they are good at and things they are bad at. Which is why we don’t all use one language/library/framework/… for everything.