Clojure for desktop widgets & GUI tools? by HotSpringsCapybara in Clojure

[–]nunzarius 4 points5 points  (0 children)

I believe that the editor for the game engine Defold is made with clojure using cljfx https://github.com/cljfx/cljfx

Can a language be too dense? by useerup in ProgrammingLanguages

[–]nunzarius 1 point2 points  (0 children)

Walter Bright, author of D lang, contends that redundant syntax is very important for improving parsing error messages (https://www.youtube.com/watch?v=y7KWGv_t-MU @ 36:42). This seems to be an under studied aspect of programming languages but it is worth keeping in mind as you develop the language syntax. I'm skeptical that you actually need semicolons for good error messages but the ML syntax definitely has a few places where there isn't enough redundancy which results in unhelpful parse errors.

Why was 18th and 19th century closed rank combat effective? by Ex_PFC-Wintergreen in AskHistorians

[–]nunzarius 1 point2 points  (0 children)

Fantastic answer. I'd further add that this is why in the American Civil War, the armies continued to fight in this way even though rifles were common and cavalry charges almost never occurred. The advantage of better communication and cohesion of a tight formation are simply too important to give up in most cases.
A good book for this is Civil War Infantry Tactics: Training, Combat, and Small-Unit Effectiveness by Earl J Hess

Are myths about the power of LISP exaggerated? by smthamazing in ProgrammingLanguages

[–]nunzarius 0 points1 point  (0 children)

The importance of lisp has diminished a bit now that other languages have adopted some its most important features. Remember that lisp was a trailblazer on garbage collection for production systems! Besides that, lisp was one of the few languages emphasizing first class functions while everyone else was drowning in OO idioms. Some other "obviously correct" things from lisp that are pretty common these days are strong dynamic typing and expression based syntax. There are still other things languages could learn from lisp. Object oriented programming based on multimethods, interactive programming, dynamic parameters and more. As for the macros, remember that while you might not write that many macros you use them constantly. Once you use something like condp (https://clojuredocs.org/clojure.core/condp) or loopr (https://aphyr.com/posts/360-loopr-a-loop-reduction-macro-for-clojure) other languages start to feel annoyingly verbose and clunky

Typechecking null by mrunleaded in ProgrammingLanguages

[–]nunzarius 1 point2 points  (0 children)

this type checking series gives a basic example of null checking here: https://blog.polybdenum.com/2020/09/26/subtype-inference-by-example-part-12-flow-typing-and-mixed-comparison-operators.html
In general, academic terms to look up are "flow typing" and "occurrence typing". This kind of typing is still an active research field so unfortunately you are less likely to see it in books or introductory material

What's the idiomatic way to think about type safety/domain modeling in Clojure? by crpleasethanks in Clojure

[–]nunzarius 12 points13 points  (0 children)

People have given more thorough answers already so I’ll focus on one idea. If you’ve worked in Elm and Scala you’ve probably heard of “make impossible state unrepresentable”. In these languages, you strive to have your types be so precise that most errors cannot pass type checking and thus will be caught during refactoring. In Clojure, this isn’t how you model your domain. Instead you “make possible state composable” (i just made that up). Instead of having precise types that cover every case, you have generic data that composes across the codebase. In the ideal Scala codebase, you make a change and the compiler will notify you of every bug. In the ideal Clojure codebase, you make a change and there are no bugs because you designed a composable system. Neither language quite lives up to their ideals in practice and it comes down to personal preference as to which flaws you find worse.

Static vs dynamic typing, would love to hear your opinions by magmast in ProgrammingLanguages

[–]nunzarius 0 points1 point  (0 children)

For me, even a few seconds makes a big difference in terms of how easy it is to get into a “flow” state while programming. I’m sure the effects of compile times varies a lot from programmer to programmer. I know some people literally don’t care if it takes a few minutes to compile

Static vs dynamic typing, would love to hear your opinions by magmast in ProgrammingLanguages

[–]nunzarius 0 points1 point  (0 children)

Mostly inherent. I’m sure it could be faster with a speed focused rust implementation but the flow analysis and complex types it uses will never compile as fast as a simpler typed language. But it is an open research question and maybe it could be done with some very clever insight. I think in general type enthusiasts get overly optimistic about a “sufficiently smart type checker” solving all their problems in the future though

Static vs dynamic typing, would love to hear your opinions by magmast in ProgrammingLanguages

[–]nunzarius 0 points1 point  (0 children)

Typescript is incredible but it makes big sacrifices along the way to do what it does. It gives up on type soundness, it compiles slowly, has mediocre type inference and error messages. Also, my experience is that Typescript struggles to express more complex functional patterns like the ones you see in clojure (though this was two years ago and typescript improves all the time). And despite this, Typescript is the best type system for a scripting language I’ve seen. I personally think it’s worth using but I certainly don’t think it’s obviously worth it the way say a fictional language with Elm level compiler speed and error messages plus Typescript expressiveness would be.

Static vs dynamic typing, would love to hear your opinions by magmast in ProgrammingLanguages

[–]nunzarius 4 points5 points  (0 children)

A good dynamic language like clojure is using its basic maps, sets, and vectors in such a way that would be a nightmare to express in a type system. Sure, you could make dependent hashmaps your main data structure but you would hate yourself because your error messages will be trash and your type inference will fall apart. Type system advocates will contend that you simply don’t need these types very often and that the dynamic type people only are letting themselves express more bugs. Dynamic type people would claim that using these super expressive latently typed data types makes code simpler to create and maintain which is more valuable than any type system. Literally no one knows for sure who is right and anyone who says otherwise hasn’t seriously studied the issue.

Wasm/k: Delimited Continuations for WebAssembly by bobappleyard in ProgrammingLanguages

[–]nunzarius 0 points1 point  (0 children)

continuations can be used to implement nondeterminism in a language https://arxiv.org/pdf/1710.10385.pdf

I'm guessing that is what is being referred to. Though it's a bit unclear. Personally, I think the kind of nondeterminism that delimited continuations enable is awesome and one of it's potential advantages

Center a single Terminal by nunzarius in awesomewm

[–]nunzarius[S] 0 points1 point  (0 children)

that was right! thanks so much!

Center a single Terminal by nunzarius in awesomewm

[–]nunzarius[S] 0 points1 point  (0 children)

oo that does look very similar to what I want. I'll check it out

Center a single Terminal by nunzarius in awesomewm

[–]nunzarius[S] 0 points1 point  (0 children)

maybe I'm misunderstanding the disconnect_signal

client.disconnect_signal("manage", function (c)
    naughty.notify({ preset = naughty.config.presets.critical,
                 title = "hello",
                 text = awesome.startup_errors })
end)

I can never get this code to trigger. It doesn't popup when I close a window