672 karma · joined Jan 29, 2020 (6y ago) · 78 submissions
1.
2 points · by sizediterable · 1y ago · discuss
comment 1y ago · link · parent
comment 1y ago · link · parent
comment 1y ago · link · parent
My solution doesn't use SIMD, but is actually takes about the same amount of time as the the solution in the article, given the same number of cores, though an glaring weakness of my approach is that it can only scale up to 7 cores as written.
Rough outline of how mine works:
- Set current best GCD to 1.
- Search through all valid board configurations.
- Bail out from the search early if the current partially generated board couldn't have a GCD greater than the current maximum found, e.g. if we've only generated two rows of the board, and the GCD of those two rows are already less than the max.
- Update the current best GCD as you find higher ones.
- Share the current best GCD value across multiple threads. That way the longer the program runs, the earlier and earlier the searches will start bailing out.
- Don't always read from the shared variable to avoid contention. Instead, each thread has its own copy of the last value it read which we compare with first before copying and caching the shared value.
- Another interesting property of this approach is that it can be used to validate the correct solution even faster than it takes to find it. Instead of initially setting the max GCD to 1, set it to `solution - 1`. That way branches in our search will bail even sooner from the beginning. This leads to the program running about 20% more quickly.
Source: https://gist.github.com/lazytype/35b45f3ea81b5c1c5555546fe6f...
comment 3y ago · link · parent
comment 3y ago · link · parent
- What does writing asynchronous code look like
- Will it have any novel or less mainstream features, e.g.
- Algebraic effects [1]
- Contexts/Capabilities [2]
- Linear types [3]
- Is the type system sound and does it support/need type casts
- Does the language support interfaces/traits/protocols
- How rich are generics, e.g.
- Explicit variance annotations on type parameters
- Lower or upper bound constraints on type parameters
- Higher-kinded types
- Is structural vs nominal subtyping more prevalent
- Does it have algebraic data types? Generalized algebraic data types?
[1] https://v2.ocaml.org/manual/effects.html[2] https://docs.hhvm.com/hack/contexts-and-capabilities/introdu...
13.
Ask HN: Open-source licenses to disallow use in any blockchain-related projects?
2 points · by sizediterable · 4y ago · 5 comments
comment 4y ago · link · parent
> Inevitably, there will be users who, for whatever reason, don't want their usage of Fig to be personally tracked. Of course. It's your data and software on your device. You shouldn't even need a reason. We want to cater to these users. And we will. But unfortunately, we are so early on in the process of building Fig that we need to be able to speak to our users. De-anonymising telemetry for the time being while minimisng the events tracked enables us to do this in a non intrusive way. But it is of course not for everyone. Therefore, once we reach a critical mass of usage in the coming months, we will then anonymise all telemetry, making Fig more accessible.
It has been several months since this was written. Are they still collecting de-anonymized user data?
15.
Bugs in Hello World(blog.sunfishcode.online ↗)
527 points · by sizediterable · 4y ago · 252 comments
comment 4y ago · link · parent
comment 4y ago · link · parent
It prompted me to learn a bit more about IFS and discover one of my favorite fractals ever. The word "chaos" where each stroke is made up of the word "chaos" [1]. I spent a bunch of time coding up the fractals on that site [2] on my calculator
[0] http://manualsdump.com/en/manuals/texas_instruments-ti-83/13...
comment 4y ago · link · parent
comment 4y ago · link · parent
If you prefer playing as an app over in a browser
https://store.steampowered.com/app/1086630/Spelling_Quest_On...
comment 4y ago · link · parent
comment 4y ago · link · parent
Converting code to Rust while keeping the logic one-to-one wouldn't work. Rust isn't ensuring memory safety by just adding some runtime checks where C/C++ aren't. It (the borrow checker) relies on static analysis that effectively tells you that the way you wrote the code is unsound and needs to be redesigned.
comment 5y ago · link · parent