Halfway through the evaluation part in the interpreter I'm writing (following the wonderful https://monkeylang.org/ book). Man this is so much fun, I have trouble thinking of anything else all day.
Code (work in progress) here: https://github.com/dannyvankooten/monkey-c-monkey-do
C programmers, how can I design this so that it compiles?
I am trying to define a struct field but the struct is not yet defined, because that struct might in turn depend on the struct I am trying to define.
Switched out React for Preact in Koko Analytics earlier today and the whole thing took less than 30 minutes, including switching out the hash-based router. Such a great job by Jason Miller and the other contributors.
Just this change got the JS bundle (admin only) size down to 130 kB (from 260 kB). 🚀
And down to 120 kB by replacing whatwg-fetch by unfetch: https://github.com/developit/unfetch .
Writing an interpreter in C and just got operator precedence parsing working correctly. So happy now. Took me some time to wrap my head around how to properly build up the tree structure for it w/ regards to memory.
Going to use this moment to stop before I get into another messy problem again and lie awake thinking about it all night.
Any tips on how to implement a hashmap in C with (close to) zero collisions while not allocating much more space than necessary?
I’m new to this sort of stuff, so pardon my ignorance. Here is what I have so far: https://github.com/dannyvankooten/c-hashmap
It distributes pretty evenly, but in my example using ~45.000 dates keys about 19% share a spot with at least one other nose.
I've got a strange question for you, #fediverse and apologies if this seems a bit forward.
I love my dog. Believe me, he is living his best life here for hopefully many more years. But I really need a vacation.
Are there people in the Netherlands interested in looking after Jazz for a few days? 🐶 Daycare is insanely expensive and all my friends and family have fulltime jobs/live in tiny apartments/have a million cats.
Implemented my first hashmap with string keys in C, feels good now I finally got it working.
It took me much too long because I was re-using memory for the keys in my tests... Derp.
Feedback is very much welcome!
Just released version 1.0.8 of Koko Analytics 📈
The state of web push notifications:
The average site has a notification prompt acceptance rate of 17%, dismissal 24%, rejection 41%, and ignore 19%.
22.76% accept on phones, 18.75% on tablets and only 6.11% on desktops.
Here's the World Energy Outlook report from the #IEA (International Energy Agency) for 2019:
They offer projections for three scenarios, continuation of business as usual, what happens if countries follow their stated energy policies, and what's required for sustainable outcomes. The executive summary is pretty easy to follow.
@neauoire Listened to your episode on The Future of Coding last night. So good to get some more... context (!) about what you're doing and why you're doing it.
Making good progress in my quest to learn a bit of C by doing the exercises from the Kernighan & Ritchie book. Coming from high-level languages it really helps solidify my understanding of things, e.g. the importance of constant time string comparison or how certain functions are usually implemented (e.g. atoi). Great fun so far!
Next up is to either write a very simple HTTP server in it (for fun only, don't worry) or to go through the "Monkey interpreter" book, but using C instead of Go.