Demo works quite strangely. For example "how to use typescript with createContext" show only typescript entries on top. Similarity search failed.
HN user
bvrmn
Nice one. gcc/clang are smart enough to get .ok condition statically. I'm very curios how complex an expression could be.
That's the reason language/compiler should directly support optionality.
You can't fool yourself and have to handle all cases: https://godbolt.org/z/4GqMdPej3
I like maybe_value dereferences NULL with SIGILL and you have at least a backtrace with exact invalid access position.
Yes it is.
1) Most of pointers in real apps are non-nullable and it's nice to have enforcement from a compiler.
2) Good compilers verify you actually check nullable (optional) values have a corresponding check. In particular Zig literally forces you to unwrap value, so no unexpected state.
It's a really amazing QoL.
And no, optionality doesn't make type system any harder. Also C lacks alignment enforcement on type level and it's a real footgun which Zig also fixed. Zig has many warts but this part (optionality, alignment and slices) makes a big difference comparing to C without Rust/C++ level of type acrobatics.
I also once believe that complex type systems are the answer, but over time I realized this is not really true.
It's suboptimal decision, you load your brain with stuff compiler should resolve for you.
Edit: ahah, just noticed your nick. Really appreciate your work on C improvements. Please ignore my yapping :) I literally know nothing comparing to you.
It's quite a delusional take from Bill. Wow. Using non-nullable (a sane language default) pointers in Zig is liberating experience. And it's still as low level as in C but instead of ship-and-pray you could state your intention with a type system.
NULL as a concept is fine. Inability to declare something as non-null is not.
There is a huge gap between developer expectation "it's pointing at something known" and hard reality confirmed by zillions of CVE. That's the reason optionality is prevalent in modern languages and type checkers (python, typescript), nowdays even Java has sane non-nullable types.
I'm a happy user of android with animations turned off. It's the only mean to make it somewhat "snappy". IMHO lag is always worse than lack of fancy transient state in input -> UI change context.
I really like Zig's approach to UB. Especially alignment is a part of type. And all this wordy builtins for conversions. Starring to it makes you think what you doing wrong with data model it requires now 3 lines of casting expression.
Another book tactically missing memory and ownership design for modern c++ apps. I think there is no more important topic for teaching. There are some slides in advanced sections but it's quite ironic one needs to know about it from the start!! Who owns memory? How to pass it? Move? Borrow? How to communicate it for readers? It's like a tribal knowledge.
Every time I touch enterprise C++ codebase it's a freakshow heavily struggling with memory management.
As reference the material could be good, as study it's very questionable.
Just in case, I'm completely fine with the policy as-is. Even more, I'm ok with making no-sense project policies. I have no business to judge how to govern other's projects.
I've assessed half a dozen before writing my own with following results:
- 2 are python resource hog
- 2 from AUR don't compile with modern GCC.
- 1 uses gtk battery icon, but uses dark version on dark taskbar, unreadable.
- 1 shows just black square.
Like I spent more time on assessment than I got a first working my tray. Amazing times.The funny thing LLM's are amazingly good with writing in Zig. They could inspect stdlib source code to fix compatibility issues with newer compilers and quite prolific with idioms.
For example I got a working application with minimal prompt like "I need an X11 tray icon app showing battery charge level". BTW result: https://github.com/baverman/battray/
Now I'm trying to implement a full taskbar to replace bmpanel2. Results are very positive. I've got feature parity app in 1h with solid zig code.
Oh boy. The major difference is coordinate transformations, global/local/face. OpenScad basically leaves you alone with math you should figure out on your own. Also it's math heavy for all other stuff, for example tangents, smooth connections, intersection coordinates, etc.
For me NF>3 seems like an implicit encoding of underlying data logic. They impose additional restrictions (usually contrived and artificial, break really fast in real life) on data not directly expressed as data tuples. Because of that they are hard to explain, natural reaction: "why you just don't store data?".
Shameless plug: https://github.com/baverman/build123d_draft
Experimental extension to make code-cadding as terse as possible.
Who is forced to use it? Just use X11, as you said (many times) you do already.
Recent versions of gnome session are compiled only with wayland support in archlinux. To change DE or distribution or use custom package is quite a stretch to call it's not forced.
I bet Fabrice could write JSAndroid which would provide no lag emulation experience.
Repairability score page[1] looks like a Lenovo advert.
[1] https://www.ifixit.com/repairability/laptop-repairability-sc...
Actually in Python you could recast (zerocopy) bytearray as other primitive C type or even any other structure using ctypes module.
Naming is atrocious indeed.
It's kinda hard to deliver value in fewer lines.
Thank you for posting it. It's the launcher I didn't know I need! My usage pattern is literally: use first desktop for often used apps and search for everything else. Samsung launcher search is quite shitty and slow and takes considerable amount of gestures to reach.
Installed and toyed with KISS for 30min and yes. It's perfect for me!
2.6 One vs. Many Check-outs per Repository
For practical cases `git worktree` allows to have multiple checkouts. Document marks this section as "partly disputed" with an external link. IMHO git worktrees has the same ergonomics as in fossil. This section kinda discredits the rest of the article.
there's no central King whose greed for wealth can be satisfied once.
King and court and lords are the same amount of greedy bastards. The issue with kings is on another plain, what to do with power transfer to a new king. Democracy try to solve exactly this problem. What to do with individuals bending laws to be new kings is another issue to solve.
I could live with 1-indexing but a closed range array unpack (slices) is quite big toll and breaks nice intuitive invariant.
1 case: 14w * 1h -> 0.014kWh * 40p of total cost. There is nothing complex.
2 case: It's an issue with mAh markings. Battery rated in Wh has same simple math.
There are no consumer issues jot solves. More over additional ~10^3 magnitude is consumer hostile.
It's hard to see practical strengths, especially with provided code examples. Most of tax code is stack tossing hiding core logic.
Code as structure could be more conveniently expressed as language data structures as structure nowdays.
It would be great to have **kwargs as frozendict by default. It could help with caching decorators to speedup key construction. For example natural key is simply `(args, kwargs)`.
That's my point. Python has convenient and good type design with str.join ignored by other languages.
For example I'm lost which abstract class to inherit in Scala to obtain mkString for my custom container.