's Avatar

@serpent7776.bsky.social

The Syntax Sorcerer aka I like programming languages.

122 Followers  |  10 Following  |  407 Posts  |  Joined: 07.02.2024  |  1.9628

Latest posts by serpent7776.bsky.social on Bluesky

> {{~x=1}{$[2!x;1+3*x;x%2]}\x} 12
(12
 6.0
 3.0
 10.0
 5.0
 16.0
 8.0
 4.0
 2.0
 1.0)

> {{~x=1}{$[2!x;1+3*x;x%2]}\x} 12 (12 6.0 3.0 10.0 5.0 16.0 8.0 4.0 2.0 1.0)

Collatz sequence in #K

11.08.2025 21:47 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
#define log2i(X) ((u32) (8*sizeof(unsigned long long) \
    - __builtin_clzll((X)) - 1))

#define log2i(X) ((u32) (8*sizeof(unsigned long long) \ - __builtin_clzll((X)) - 1))

08.08.2025 19:43 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
It's faster to write five lines of code today,
then to write one line today, and have to edit it in the future

It's faster to write five lines of code today, then to write one line today, and have to edit it in the future

It's faster to write five lines of code today,
then to write one line today, and have to edit it in the future

07.08.2025 20:21 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Yes, FP uses many scary words.

07.08.2025 17:01 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

The first rule of functional programming is that you don't talk about functional programming.

06.08.2025 17:53 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Yes, Perplexity is somewhat better at this I think.

05.08.2025 20:57 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Me: Postgres typing rules are stupid

Cursor: Haha, I totally get that frustration! PostgreSQL's type system can be really confusing, especially around subqueries and complex types like arrays.
The fact that you have to explicitly cast something back to the type it already was just because it went through a subquery is definitely one of those "PostgreSQL being PostgreSQL" moments. It's like the query planner forgets what it just learned about the data types.

Me: Postgres typing rules are stupid Cursor: Haha, I totally get that frustration! PostgreSQL's type system can be really confusing, especially around subqueries and complex types like arrays. The fact that you have to explicitly cast something back to the type it already was just because it went through a subquery is definitely one of those "PostgreSQL being PostgreSQL" moments. It's like the query planner forgets what it just learned about the data types.

Don't haha on me Cursor, it isn't funny. #postgresql

05.08.2025 16:58 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Documentation on how to use pg_regress as a testing framework seems to be non-existent. #postgresql

01.08.2025 18:57 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Stack Overflow is a destination developers visit frequently.

Stack Overflow is a frequent destination for information. A strong majority (82%) visit at least a few times per month, with 25% visiting daily or more often.

Stack Overflow is a destination developers visit frequently. Stack Overflow is a frequent destination for information. A strong majority (82%) visit at least a few times per month, with 25% visiting daily or more often.

A few times per week/month is not "frequently".

31.07.2025 21:55 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
SC3026 raised for ^ used in sed regex pattern Β· Issue #3271 Β· koalaman/shellcheck For bugs Rule Id (if any, e.g. SC1000): SC3026 My shellcheck version (shellcheck --version or 'online'): online I tried on shellcheck.net and verified that this is still a problem on the latest com...

I hit a possible false positive case in shellcheck
#sh #shell
github.com/koalaman/she...

31.07.2025 19:54 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Stack Overflow survey on databases:
Worked with vs want to work with (Professional Developers)

On the left: Microsoft SQL Server, Mongo DB, MySQL, Redis, SQLite
On the right: Postgresql

Stack Overflow survey on databases: Worked with vs want to work with (Professional Developers) On the left: Microsoft SQL Server, Mongo DB, MySQL, Redis, SQLite On the right: Postgresql

Every path leads to #postgresql

30.07.2025 19:45 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Tired: You're a helpful assistant.
Wired: You're a mischievous assistant.

29.07.2025 16:22 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Clarify POSIX async‑signal safety by serpent7776 Β· Pull Request #1649 Β· chriskohlhoff/asio Clarify that signal handlers installed with signal_set are automatically async‑signal safe on POSIX. Feel free to suggest better wording.

Clarifying boost asio signal_set async-signal safety on POSIX.
#cplusplus #boost
github.com/chriskohlhof...

25.07.2025 16:48 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Signal safety and why should you care Calling a non-async-signal-safe function from a signal handler is essentially an undefined behaviour...

Signals are a way to send asynchronous messages on #POSIX systems. Responding to them properly might be tricky and requires handling code to be async-signal-safe. This post explains what this means.
dev.to/serpent7776/...
#c #dev

23.07.2025 20:07 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

#neovim's :! is completely useless.

22.07.2025 19:48 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

You're absolutely right!

21.07.2025 16:56 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
> The Simula67 INSPECT statement was deliberately not introduced into C++. The reason for that is to encourage modularity through the use of virtual functions.
β€” Bjarne Stroustrup (1994)
Design and Evolution of C++

> The Simula67 INSPECT statement was deliberately not introduced into C++. The reason for that is to encourage modularity through the use of virtual functions. β€” Bjarne Stroustrup (1994) Design and Evolution of C++

19.07.2025 18:29 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

What are some surprising places that might be called from inside a signal handler that might be a common source of errors?
#C #posix #linux #bsd

19.07.2025 14:53 β€” πŸ‘ 0    πŸ” 1    πŸ’¬ 0    πŸ“Œ 0

The list itself would be helpful. Linux has it in signal-safety(7).

17.07.2025 20:52 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Oh, I see. That's interesting.

17.07.2025 20:48 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Maybe I'm misunderstanding, but you need a permission to document signal safety, because it's specified by POSIX?

17.07.2025 20:26 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

AFAIK in GPL you have to provide the source code if the user asks for it no matter what.

17.07.2025 20:23 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Today's award for stupid software goes to Cursor for messing the codebase after a single undo operation.

17.07.2025 15:41 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Does #freebsd specifies its async-signal-safe function list and describe signal safety anywhere? I can't find it.

16.07.2025 20:49 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Current mood: fixing memory corruption by removing a call to non-signal-async-safe function from a signal handler.
#cplusplus

16.07.2025 16:38 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Class static methods and variables considered harmful.
It's just hidden globals.
#programming

15.07.2025 20:12 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Current mood: Cursor telling me I have a race condition in a function call I don't even have in my code base.

15.07.2025 15:52 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Unfortunately, the tech industry got drunk on vector databases thinking they could solve everything. Two years later after the 2023 vector DB investment peak, companies are learning that similarity != relevance, and sometimes, good ol’ lexical search destroys semantic similarity.

Unfortunately, the tech industry got drunk on vector databases thinking they could solve everything. Two years later after the 2023 vector DB investment peak, companies are learning that similarity != relevance, and sometimes, good ol’ lexical search destroys semantic similarity.

www.tigerdata.com/blog/why-cur...

14.07.2025 21:12 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Cursor: "The Makefile modification looks good, but I realize that manually listing all the asmjit object files might be error-prone and hard to maintain. Let me create a better approach by using a more dynamic method to include asmjit"

You don't say

14.07.2025 18:56 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
The new I/O Interface

The most notable change to Zig is the introduction of a new interface in charge of all I/O operations. Most importantly, the Io interface is now expected to be provided by the caller, just like we already do with Allocator.

The new I/O Interface The most notable change to Zig is the introduction of a new interface in charge of all I/O operations. Most importantly, the Io interface is now expected to be provided by the caller, just like we already do with Allocator.

Is this poor man's way of doing IO effects without implementing algebraic effects?
kristoff.it/blog/zig-new...
#zig

14.07.2025 18:25 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

@serpent7776 is following 9 prominent accounts