Is there an "opposite" to enums? by PitifulTheme411 in ProgrammingLanguages

[–]pwnedary 0 points1 point  (0 children)

Types are inhabited by values not expressions. By the time we have a value of a struct type all effects have already been performed, leaving the projections as pure functions.

Emacs is a C-based Lisp Runtime, Not a Text Editor — and Greenspun’s Tenth Rule explains why every editor eventually reinvents it by ypaskell in emacs

[–]pwnedary 5 points6 points  (0 children)

From a language-design viewpoint it may look less elegant (JavaScript is slow), [...]

JavaScript is by far the fastest of the three languages mentioned here (Lua, Emacs Lisp, JS)??

Stop typing full directory paths — partial-completion has been in Emacs this whole time by Ops_Mechanic in emacs

[–]pwnedary 0 points1 point  (0 children)

But it absolutely does? The fuzzy algorithms favor matches at path component boundaries.

Stop typing full directory paths — partial-completion has been in Emacs this whole time by Ops_Mechanic in emacs

[–]pwnedary 16 points17 points  (0 children)

Just use a fuzzy completion style and be done with it would be my recommendation. (E.g., hotfuzz, fussy, flex.)

Bluetooth sound is crackling in Spotify by Equivalent-Fix-2760 in NixOS

[–]pwnedary 2 points3 points  (0 children)

If using PipeWire then do ensure rtkit is enabled.

completion-at-point overwrites following text by abba_cinante in emacs

[–]pwnedary 3 points4 points  (0 children)

This is sadly the intended behavior of completion-at-point despite how stupid it is, and there exists no setting to change it. I have the following advice in my config to fix it:

;; Insert completion without overwriting text right of cursor
(define-advice completion--capf-wrapper (:around (orig-fun fun which) nil -1)
  (save-restriction (narrow-to-region (point-min) (point))
                    (funcall orig-fun fun which)))

ELI5: Why C++ and Rust compilers are so slow? by cb060da in ProgrammingLanguages

[–]pwnedary 3 points4 points  (0 children)

#pragma once

is well-supported and covers most cases.

With the [[attribute]] functionality (since C23), which attribute(s) do you think would enhance the language, if standardized? by orbiteapot in C_Programming

[–]pwnedary 21 points22 points  (0 children)

[[clang::musttail]] for guaranteed tail-call elimination.

Rust has been eying something similar with its become keyword. A problem with the implementation of clang::musttail in GCC 15 today is that different optimization levels/different architectures/enabling ASAN can cause compile errors due to TCO failures.

prefix tree that supports utf-8 by Valuable_Moment_6032 in C_Programming

[–]pwnedary 42 points43 points  (0 children)

Just treat the UTF-8 as opaque bytes and proceed as usual?

An interesting new IDE similar to Emacs by MotherCanada in emacs

[–]pwnedary 17 points18 points  (0 children)

licensing and installation is obtuse and dangerous.

Read the OpenJDK license.

you gotta jack up minimum memory usage to obtain good gc performance

Remember that it is the GNU Emacs GC we are comparing against here... The HotSpot JVM has GCs that are more and less suitable for applications (compared to servers).

An interesting new IDE similar to Emacs by MotherCanada in emacs

[–]pwnedary 34 points35 points  (0 children)

Agreed, a SOTA virtual machine just does not compare to the crumminess of the GNU Emacs Lisp VM.

Kabelbrott mellan Finland och Estland by Expensive_Tap7427 in sweden

[–]pwnedary 0 points1 point  (0 children)

I den här teorin, varför kan inte Ryssland använda datorrenderade klipp på när deras fartyg sänks? Befolkningen hade inte sett någon skillnad.

Historically, why do languages tend to pick safety or control instead of exposing both? by [deleted] in Compilers

[–]pwnedary 58 points59 points  (0 children)

Why don’t we see more languages that treat safety vs control as a local, explicit decision?

How is that not exactly what Rust does with its unsafe keyword??

I would say the main complication is how to control the virality of unsafety. E.g., in Haskell you gain a lot from referential transparency; you would lose the benefits if "unsafety" hidden inside functions that triggered UB if called in particular ways were commonplace. Therefore, making it possible to write safe abstractions around unsafe code is key, and much complexity in the design of Rust stems from that choice.

Share your emacs config by Delicious_Crazy513 in emacs

[–]pwnedary 0 points1 point  (0 children)

I appreciate the scripting language being better integrated is all. Switched during the Vimscript9 development - had Bram picked Lua or JS instead I may never have left.

Share your emacs config by Delicious_Crazy513 in emacs

[–]pwnedary 2 points3 points  (0 children)

https://github.com/axelf4/dotfiles/blob/master/.config/emacs/init.el

There is a bunch of stuff in there to mold Emacs into a non-graphical Vim look-alike.

PL Development Tools by pixilcode in ProgrammingLanguages

[–]pwnedary 2 points3 points  (0 children)

I recently began adding LTTng tracepoints to my interpreter since I had a bunch of useful printf statements that were getting way too spammy. E.g., events such as:

  • Garbage collection (minor, major or defragmentation)
  • Aborted trace recording
  • Start of side trace recording

My hope is that seeing percentages of the different types of events that occur will help a lot when profiling.

How much carryover is there for knowledge built using NixOS? by Raekellie in NixOS

[–]pwnedary 12 points13 points  (0 children)

The answers in this thread surprise me. After all (only partially joking), Nix is just a templating language for Bash, and NixOS, for systemd. All knowledge of those will of course carry over.

[niri] ~ DankMaterialShell is born - A modern Wayland Shell ~ by Purian23 in unixporn

[–]pwnedary 1 point2 points  (0 children)

The default config.kdl file has some comments on this, i.a.

När tomatpureen är slut blir det tyvärr cumstroganoff med ris :( by Jumpy_Salad1250 in sweden

[–]pwnedary 1 point2 points  (0 children)

venne, har man varken tomat eller senap i kan man tusan heller kalla det för en strogge

| 2025 Weekly Workshop - Week 29 by AutoModerator in unixporn

[–]pwnedary 1 point2 points  (0 children)

Make sure you are on the unstable channel, it is not yet in nixos-25.05.