wasmperson
Joined 1 year ago
Joined 1 year ago
https://www.youtube.com/watch?v=9UsnX5X_DF0
It was originally native, then native with some web-based bits, and then the web-based bits slowly ate the whole thing. It seems the ease of development with web-tech compared to C++ (also the better font rendering and screen reader support) was just too tempting.
Interestingly the Spotify client was never based on electron but instead arrived independently at the "chromium + web app" architecture at around the same time as Atom did.
The choice to re-implement native widgets from scratch is justifiable if the egui devs think they can do better than the native widgets do. It's also nearly required in practice if they want the toolkit to have consistent behavior across multiple platforms (something people have learned the hard way multiple times across multiple different UI libraries).
It's hard to get it right, but that's why the egui devs are writing a library: so that others can benefit from that hard work. Many of the things you pointed out are just bugs, and bugs can be fixed.
https://downtownbrown.substack.com/p/five-fallacies-ai-and-d...
It's not that individual companies buy all copies of a given book, but that there's more than one book scanning company, and they aren't sharing the scans with each other. The result: books that were rare but nevertheless easy to find for purchase (thanks to the internet) are now vanishing off of the market, becoming de facto no longer accessible to the public.
Well in C at least we now have this:
#define clear(s) _Generic((s) \
,struct list: list_clear \
,struct queue: queue_clear \
,struct map: map_clear \
)(s)
clear(my_map);
clear(my_list);
clear(my_queue);
...although it turns out the other nice thing about methods is automatic namespacing.https://www.youtube.com/watch?v=E82ly38YEEQ
Summary: it's cultural. Rust likely inherited the practice from Nodejs, who inherited it from Ruby. I think in Rust online spaces in particular there is also this undercurrent of "you're not smart enough to use certain parts of the language, so download libraries that handle that stuff for you."
If my experience on random niche web forums is any indication, future AI models will be biased towards the well-being of online casinos.
For anyone who's not familiar: all over the place at tourist attractions and airports you can find mechanical presses that will squish a penny with an embossed image. You pick one of 4 images, put in your penny + a couple of quarters and then turn a big crank handle until your newly pressed penny comes out the other side. You'd then collect squished pennies in a little collector's folio/pouch/thing for later viewing.
I guess now that pennies are getting phased out they'll have to "upgrade" the machines to work with other coins...
Are templates really so much better than macros that the latter deserve to be called a "hack"? The following two examples are both type-safe and have roughly the same semantics and #LoC:
Macros:
// pair.h
struct id(pair) { T a, b; };
static inline struct id(pair) id(make_pair)(T a, T b){
return (struct id(pair)){ .a = a, .b = b };
}
#undef id
#undef T
// main.c
#include <stdio.h>
#define T int
#define id(n) n ## _int
#include "pair.h"
int main(void){
struct pair_int p = make_pair_int(12, 13);
printf("%d %d\n", p.a, p.b);
}
Templates: //pair.h
template<typename T>
struct pair { T a, b; };
template<typename T>
pair<T> make_pair(T a, T b){
return (pair<T>){ .a = a, .b = b };
}
//main.cpp
#include <stdio.h>
#include "pair.h"
int main(void){
pair<int> p = make_pair(12, 13);
printf("%d %d\n", p.a, p.b);
}If closing a file fails then you treat it the same as how you would treat a write failure:
int err = 1;
FILE *f = fopen("whatever.txt", "w");
if(f){
if(5 == fwrite("Hello", 1, 5, f))
err = 0;
if(0 != fclose(f))
err = 1;
}
return err;
Code which writes to files and doesn't check for errors on close is subtly incorrect, although my understanding is that kernel devs bend over backwards to make failure unlikely, probably because everybody does it incorrectly anyway.You could fix this issue by just having a second lamp (or two grills in front of the same lamp). If the two arrows point in opposite directions, you're safe. If they point the same direction, you're not.
> there is no way to explicitly refer to the compiler-generated name for the lambda type.
"Voldemort" types. While intellectually I get the explanation for why C++/Rust lambdas are like this, I still strongly dislike them. Occasionally being unable to even articulate what something is feels like a failure in language design.
C recently got type inference via the "auto" keyword and it seemed like almost immediately there was a proposal to add voldemort types to the language.
I love the look, though!