HNHacker News
TopNewBestAskShowJobs

floitsch

564 karma · joined March 29, 2013

I worked on Dart. Now developing Toit.
submissionscomments
floitsch··on The Toit language is now open source
The Toit language isn't bound to run on ESP32s.

We routinely run it on our desktops as well.

floitsch··on The Toit language is now open source
To me those two sound quite different.

Here is, how we pronounce it: https://www.youtube.com/watch?v=JVKb8cm1B20

floitsch··on The Toit language is now open source
I believe I once managed to make Toit run in web-assembly.

I know for sure that the compiler compiled to it, but I'm pretty sure I also had a "hello world" that worked.

I would need to find that branch and see if it still merges cleanly.

floitsch··on The Toit language is now open source
It's not Go ;)

In all seriousness, though: if you like Go, then tinygo could be a good solution.

Personally, I find coding in Toit just a much more pleasant experience.

floitsch··on The Toit language is now open source
It's this one: https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.29...
floitsch··on European Payments Initiative (EPI)
Note that "nets" is on the list.

They represent 250 banks across Europe (according to their web-page): https://www.nets.eu/who-we-are

For example, Danske Bank (the biggest Danish bank) uses them.

floitsch··on European Payments Initiative (EPI)
Credit card payments in Europe now have to have 2-factor authentication.

This makes fraud much harder, while still allowing online payments with credit cards.

It is probably also helping smaller shops, as even Amazon customers now need to do something when they buy there.

floitsch··on Finland provides housing and counseling to the homeless (2020)
That's why you compare per capita.
floitsch··on Finland provides housing and counseling to the homeless (2020)
Finland is not really a country that relies heavily on natural resources.

First page I found ranks the US as having more income from natural resources than Finland.

https://www.theglobaleconomy.com/rankings/natural_resources_...

floitsch··on An efficient way to make hash maps with insertion ordering
It's not that simple.

The index table needs to be sparse (for the hashing to work), and thus has quite a few entries unused. It also wants to be small in memory to improve cache locality.

Therefore you want to have the entries in the index-table as small as possible.

As example, let's say you have n entries in your map which is 2/3 full. Let's assume the key and the value each take 1 word.

In the index+key+value case you would thus use: n1.5 words for the indexes, and n2 words for the keys/values. -> 3.5 words per stored key/value.

In the key+value case you would need (2n)1.5 words. -> 3 words per stored key/value.

However, that assumes that the index-table uses a full word per entry. That's usually not the case, as you can use smaller types while the map is small enough. On 64-bit machines, the index-table will rarely use more than 32-bit arrays. In that case you would only need 2.75 words per stored key/value.

That's not really fair, though, as the value/key table has some unused space, so that it doesn't reallocate/copy every time a new key/value is added. Implementations can play with how much extra space is allocated for those unused slots.

Also, the "hash" you mentioned can be combined with the redirecting index. For Toit (the map of the blog post), the index table uses 32 bits. In these 32 bits it stores both (part of) the hash code, as well as the redirecting index.

It might be the case that the hash+key+value approach uses less memory, but I would not be confident to say that it's always the case.

floitsch··on An efficient way to make hash maps with insertion ordering
Which unavoidable memory overhead?

The hash map as described in the article doesn't seem to waste any memory.

floitsch··on An efficient way to make hash maps with insertion ordering
You were stating that "[...] it definitely is using memory it wouldn't need if it didn't preserve order.".

There is no reason for that. A sorted list doesn't need more memory than an unsorted list. And an insertion-sorted map doesn't need to use more memory than a map that doesn't keep the order.

Independently, some properties we deem valuable are often side-products of the way the data-structure works. For example, an efficient binary search tree will naturally tend to be balanced. In the case of efficient hash maps, it is now common to add the key/value pair at the end of an internal vector. Maintaining the insertion order this way doesn't add any cost.

floitsch··on An efficient way to make hash maps with insertion ordering
With that reasoning a sorted list would need more memory than an unsorted list.
floitsch··on An efficient way to make hash maps with insertion ordering
Rust has hash maps that hate you.

The default hash map visits the keys in arbitrary order (https://doc.rust-lang.org/std/collections/struct.HashMap.htm...).

You could use a BTreeMap, but that's not insertion order and requires the user to come up with some sort of ordering.

floitsch··on Ten Kilograms of Chocolate (2020)
The brand seems to be available mostly in Germany and Denmark.

A very similar chocolate seems to be Vivani (from the same manufacturer). "Vivani edel bitter 70%". Maybe that one is easier to find.

floitsch··on Ten Kilograms of Chocolate (2020)
If it had been available in common Danish supermarkets I would have included it :)
floitsch··on Ten Kilograms of Chocolate (2020)
As mentioned in the post: the Cote d'Or and Suchard chocolates are extremely similar, and only had a minor difference in the ingredient list. If we had known, we would not have included both.
floitsch··on Ten Kilograms of Chocolate (2020)
Will keep that in mind.

It's very hard to present tables on Medium. If someone knows a better technique I would be happy to learn about it.

floitsch··on Ten Kilograms of Chocolate (2020)
Happy to answer questions about the participants.

For the "Knack": I'm not 100% sure either. I think he meant that it had a nice snap/crunch.

floitsch··on Can you IoT an Airwick air freshener? (2020)
Me too. I used the existing board and connected myself directly to the transistor.

Used http://toit.io to connect the ESP32 to the cloud so I could control it from my phone (with a tiny Flutter app).

floitsch··on Identical twins are not so identical, study suggests
This is pretty rare. Almost all test of twins that are in doubt are identical.

Don't have a source right now but I remember because we wondered if we should take a test as well. In retrospect (now 40+ years old and still looking very similar) it's hard to understand why we every doubted.

floitsch··on Why is subtracting these two times in 1927 giving a strange result? (2011)
I implemented (part of) the Dart date/time library. Lots of fun stuff with time zones...

Wrote a blog post about the most interesting things I found: https://medium.com/@florian_32814/date-time-526a4f86badb

floitsch··on Look ma, no mouse: Vimium
I wrote a Chrome extension with a similar purpose.

https://chrome.google.com/webstore/detail/ctrl-access/glmoeh...

The idea was copied from Konqueror.

floitsch··on Year-round daylight time will cause ‘permanent jet lag,’ sleep experts warn
They did.

https://en.wikipedia.org/wiki/Time_in_Spain#Criticism_of_the...

floitsch··on Year-round daylight time will cause ‘permanent jet lag,’ sleep experts warn
Spain has long been suspected to suffer from their timezone choice. I do remember reading about that problem before, and a fast Google search finds several articles discussing the issue. (For example https://www.theguardian.com/commentisfree/2017/feb/22/spania...)

Up to a certain point, countries adapt. For example, Germany and France are in the same timezone, but their schedule is shifted. This can be easily seen when looking at the TV schedules. In Germany, evening TV starts at 20:15 (the start of movies, ...). In France it's more like 21:00. When I lived there it was 20:50, but TF1 now seems to start at 21:05.

German TV: https://www.zdf.de/live-tv

French TV: https://www.programme-tv.net/programme/chaine/programme-tf1-...

Similarly, schools and kindergardens are usually not at the same time.

This local shifting works more or less, but can't be stretched too far. Especially multinational companies have expectations that workers come in at certain times. This is the problem that Spain faces. (I couldn't easily check by how much Spanish are shifted as Spanish TV schedules don't seem to coordinated like in France or Germany).

floitsch··on Grandmaster level in StarCraft II using multi-agent reinforcement learning
Hi Brian,

I really hope this will change, though. Skilled AIs could make so many games more interesting and better.

Many online games really suffer from bad multiplayer experiences. Players that drop in the middle of a game, ...

If Overwatch, Destiny, ... had really good AIs, that would make the game more attractive. If a player drops, they could replace it with similarly skilled AI. Instead of waiting for 12 players of the same skill-level, they could just play with some AIs.

They could even make it such, that humans win 70% of the time, and let the AIs just lose more often.

floitsch··on Grandmaster level in StarCraft II using multi-agent reinforcement learning
I don't think the comparison with aimbots is fair. Aimbots are more like a perfect micro. In the beginning (when they did their first show match), Alphastar was insane at that. Now the micro is not giving an advantage anymore.

Where alphastar shines, is in making a strategy work. It won't attack into something that looks dangerous. It won't forget to build more units. It won't be distracted on two fronts. (That said: Alphastar did some really stupid mistakes as well.)

I agree with you, though: it would be much more interesting, if Alphastar was actually handicapped in the micro (at least at a later point in the game). Then it would really need to find interesting strategies and counter opposing units with more cost-efficient ones.

floitsch··on Grandmaster level in StarCraft II using multi-agent reinforcement learning
The question isn't whether the AI still has advantages, but whether it's an unfair one. The current restrictions were implemented with input from TLO, and seem to work quite nicely.

One could, of course, add more restrictions (like not noticing things on the minimap all the time...), but that's not what's it about anymore. At this point, micro is comparable to humans, and we can start to compare macro and strategy.

Fwiw, when I watched some of the replays, I was disappointed by AlphaStar. It's a very consistent player with few mistakes, but it isn't very reactive and definitely not inventive. Instead of switching tactics when things don't work out, it generally continues with the chosen strategy. Often, that's enough: a well executed strategy with few errors often wins, even if it wasn't optimal.

floitsch··on Grandmaster level in StarCraft II using multi-agent reinforcement learning
These extremely difficult/impossible things didn't really give an advantage. For example, AlphaStar would sometimes click on an object at the border of the screen. For humans that would be almost impossible, because the screen would scroll when the mouse approaches the border.

Similarly, AlphaStar would not play with group hotkeys, but use a different technique. However, in none of the analyses, people noticed things that would give AlphaStar an unfair advantage.

floitsch··on Formatting floating point numbers
Depends.

"Correct" conversion, where the length doesn't matter (which could be called "fixed length" for a certain length that is big enough) is easier, because one can avoid a lot of rounding and imprecision issue: using the right technique, just produce enough digits until the imprecisions don't matter anymore.

However, fixed length is as difficult as the shortest, if the length is limited, since the last digit sometimes lies on the boundary and thus runs into the same difficulties as the shortest digit. Think of it this way: needing to decide whether 6 digits is enough, is often similar to asking whether the 6th digit is a 0 or a 9 (roughly speaking). This means that producing the best fixed-length representation (for length 6) runs into the exactly same question.

← PreviousPage 3 of 5Next →