HNHacker News
TopNewBestAskShowJobs

fjfaase

2,267 karma · joined March 20, 2017

Software engineer with more than 30 years experience writing software in mostly C++. Interest in parsers, interpreters and combinatorics problems.

* https://www.iwriteiam.nl/ * https://github.com/FransFaase * https://fjfaase.at.hn

submissionscomments
fjfaase··on I wrote my own “proper” programming language (2020)
If you want to design your own language, you might want to start with IParse Studio, an interactive online parser that parses input according a grammer at every keystroke returning a parse tree, if the input can be parsed according the grammar.

Once you have the grammar, you can use it with IParse developed in C++, which produces an abstract parse tree.

IParse has a build-in scanner for C like terminals, which are now used in many languages. You can implement your own scanner. IParse also has an unparser, which allows you to generate pretty printed output with just some annotations in the grammar.

fjfaase··on When the Simplest Concurrent Program Goes Against All Intuition
I think that the following PROMELA code proofs it:

    byte n = 0
    byte A = 0
    byte B = 0
    proctype Client(byte id)
    {
        do
        :: (A == 0) -> B = id
        :: (A == id) -> 
            n = n + 1;
            assert (n <= 1);
            n = n - 1;
            A = 0
        od
    }
    proctype LockServer()
    {
        do
        :: (A == 0) -> A = B
        od
    }
    init {
        atomic {
            run LockServer();
            run Client(1);
            run Client(2);
            run Client(3);
        }
    }
It fails when two 'Client(2)' is replaced by 'Client(1)'
fjfaase··on When the Simplest Concurrent Program Goes Against All Intuition
The idea is that there is one task that does the locking. It does so by copying a value from a memory location A to B, when B is equal 0 (the initial value) at regular intervals. Any task that wants to get the lock, writes a unique task identifier (unequal to 0) to memory location A and starts polling B. When it becomes equal to its task identifier, it did get the lock. To release the lock, it writes 0 to B. If it did not get the lock and sees that B has become zero, and A is different, it may overwrite A with its own task identifier.

This locking is 'slow' and has 'unfair' behavior.

fjfaase··on Flexoki Color Scheme
Interesting. Ik looks like all the colord have the same brightness and saturation. There is s Dutch artist, Peter Struycken, who has been making art works and color pallets (for offices) on these priciples.
fjfaase··on Rewriting my website in plain HTML and CSS
In 1995, I started with a personal website based on HTML. Since then, I have added a little bit of CSS to the home page, but all the other files are in plain HTML. For that reason it looks very old school, but that is okay with me.

I have been adding some JavaScript through the years. Some for generating content, some for graphics and animations. I also have written a C program for checking the HTML and all the internal links and the use of tags. The program places all updated files into a folder ready for upload with FTP.

To edit the HTML, I use an editor (based on Crystal Edit) that also can navigate HTML files: when pressing F5 on a link, it opens the file in the editor (or in the default browser when it is an external link), and if there a tag in the link, positions the cursor at that line.

See for more details: https://www.iwriteiam.nl/SiteMain.html

fjfaase··on When the Simplest Concurrent Program Goes Against All Intuition
This implicitely assumes atomic assignments, meaning that during an assignment all bits representing a value are transfered in one atomic unit. This sounds a bit trivial, but if one would be working with large integers that are stored in multiple memory words, it is less trivial.

I think it is possible to implement locking with only atomic assigments.

fjfaase··on Literate programming: Knuth is doing it wrong (2014)
Look for the file MarkDownC.cpp and search for 'elipses', which stands for '...'. The code makes use of AbstractParseTreeCursor, which is a kind of smart pointer. (The is quite a bit of code that is commented out.) You can contact me through the email mentioned at the bottom of my website www.iwriteiam.nl
fjfaase··on Literate programming: Knuth is doing it wrong (2014)
For 'Advent of Code' I have been using a kind of literary programming method based on Markdown files. I have written a parser that can read Markdown files with segments of C code and put all the segments in the correct order to be compiled. For an example, see: https://github.com/FransFaase/AdventOfCode2023/blob/main/Day...

I also used it as a documentation for parser I have been developing, which shows the literary programming style in a better way. The program can combine several Markdown files into a single C program. See: https://github.com/FransFaase/RawParser?tab=readme-ov-file#d...

fjfaase··on A Bivariate Map with Observable Plot
I do remember that Scotland was mostly colored orange and the area around London blue. Now it is the way around.
fjfaase··on A Bivariate Map with Observable Plot
Would it more intuitive to swap the colors in the example: blue for more presperation (water) and red for higher temperatures?
fjfaase··on The smallest Hello World program
Would it be fair to name the program 'Hello World!' and than use argv[0], which is on the stack, to print out 'Hello World!'?
fjfaase··on How do I pay the publisher of a web page?
The European Union is working on a standard for QR-code payments [1]. In the Netherlands, most banking app already understand QR-code for payments. There are serviced that offer a possibility to ask for a payment without a specified amount that do not the reveal the bank account of the requester.

If this could be turned into a world wide standard, one could add a link to a QR code in a web page to request for donations. One should realize that there are very different payments systems in the world and that there are payment companies, think credit card companies, that have good reasons to resist these kind of global standards.

[1] https://www.europeanpaymentscouncil.eu/document-library/guid...

fjfaase··on Translating my Grandfather’s biograpy
My wife has done a lot of genealogical research and has experience with reading cursive text going back to about 1700 in both Dutch and German. (Many Dutch people have German ancestors.) A lot depends on the quality of the scans. You can contact me through the email address mentioned on my website, which is mentioned in my profile.
fjfaase··on Yi Peng 3 crossed both cables C-Lion 1 and BSC at times matching when they broke
On November 21, 2024, 6:35 UTC: It looks like the pilot ship Styrbjoern is traveling in the direction of the Yi Peng 3 bulk carrier again.
fjfaase··on Yi Peng 3 crossed both cables C-Lion 1 and BSC at times matching when they broke
It looks like that the pilot ship Styrbjoern [1] came along side the Yi Peng 3 today. It traveled from the harbor of Grenaa to the ship and back. It possible that they took some people in for questioning or put a pilot and/or guards on the ship.

[1] https://www.vesselfinder.com/?mmsi=219003826

fjfaase··on Windows Memory Mapped File IO
A memory mapped file can be used to store complex object oriented structures if you make use of 'relative' pointers, where you have to add the address of the pointer to the pointer to get to the object you are pointing to. I once used this method, to persist a complex data structure without having to write serialization code.

A long time ago, I implemented some C++ classes that would hide most of the additional work and also took care of allocating new objects inside the memory mapped file. See: https://www.iwriteiam.nl/D0205.html#13MMF (Note that this implementation actually makes use of a slightly different approach where pointers are relative with respect to the first position of the file. This implementation has the limitation that you can only open one such store as a memory mapped file. It was only later I realized that it was possible to do without the offset. I never came to rewriting all the code.)

fjfaase··on The Script Creator
The script has been added to Unicode in 2014. Information about the characters, their pronunciation and mapping to Latin characters can be found in 'Proposal to Encode the Pau Cin Hau Alphabet in ISO/IEC 10646' [1].

[1] https://www.unicode.org/L2/L2011/11104r-paucinhau-alphabet.p...

fjfaase··on Language is not essential for the cognitive processes that underlie thought
As some who has a dis-harmonic intelligence profile, this has been obvious for a very long time. In the family of my mother there are several individuals struggling with language while excelling in the field of exact sciences. I very strongly suspect that my non-verbal (performal) IQ is much higher (around 130) than my verbal IQ (around 100). I have struggled my whole life to express my ideas with language. I consider myself an abstract visual thinker. I do not think in pictures, but in abstract structures. During my life, I have met several people, especially among software engineers, who seem to be similar to me. I also feel that people who are strong verbal thinkers have the greatest resistance against idea that language is not essential for higher cognitive processes.
fjfaase··on The C23 edition of Modern C
There are still applications (especially with embedded devices) where you do not dynamically allocate memory or might not even use pointers at all.
fjfaase··on Why 4x8 and 6x8 are, surprisingly, some of the hardest times tables to remember
Took me the longest (about 40 years) to memorize 7x8. Before being able to memorize it, I would usually add 7 to 49. For some reason, the squares stuck in my mind rather easily. So, 7x7 and 8x8 are easier. I cannot remember having problems with 4x8 and 6x8. Maybe because 48 is double of 24, which is double of 12. I have to say that my performance IQ is much higher than my verbal IQ.
fjfaase··on Dynamicland 2024
I wonder whether someone already has build away to create modular synthesizer using block with knobs on the table. A line on the top of the knob would signal its position. (In the video I saw some shots that looked like sequencers.) You would also need some mechanism to connect the modules together. I played around with VCV Rack [1], but adjusting knobs with a mouse feels very different than using your hands to turn a physical knob. Also, I would like to have more freedom in arranging modules more freely as you could do on a table, instead of using patch cables that go into all kinds of directions. Especially for newbies, it would be an interesting way to see if they want to go into real modular synths based on Eurorack [2], AE Modular [3] or microrack [4].

[1] https://vcvrack.com/

[2] https://en.wikipedia.org/wiki/Eurorack

[3] https://www.tangiblewaves.com/

[4] https://microrack.org/

fjfaase··on Generating Mazes
Maze generation is a fascinating topic. I also played with different maze generating algorithms and wrote a program [1] that generates SVG files that can be send to a laser-cutter. I used it to do some investigations on the statistics of different types of algorithms. I have some fascination with mazes that only have rooms with either one or three exits [2]. I used the program to create an kind of inverted maze with different heights which now hangs in my living room. [3]

[1] https://github.com/FransFaase/MazeGen

[2] https://www.iwriteiam.nl/counting.html#paper

[3] https://www.iwriteiam.nl/D2006.html#21

fjfaase··on The Atlantic is cooling at record speed
After reading the article more careful, it seems that it is about the cooling of the Atlantic near the equator. I understand that articles on site like the New Scientist do not include links to the original scientific reports or data, but at most links to the people they are quoting. This makes it difficult to verify the statements or to even precisely understand what it is about. The Atlantic is a large ocean reaching from almost the arctic to antarctic, an averages of some parts of it could only have a weak correlation with each other even if they are partly overlapping.
fjfaase··on The Atlantic is cooling at record speed
According to Daily Sea Surface Temperature, North Atlantic [1] the temperature is indeed lower than last year, but it is still higher than it was before the record temperatures of 2023 and above the 2σ plus for the 1982-2011 mean. So, the cooling is rather relative if you take these figures. Maybe the article is referring to another measurement of the temperature of the Atlantic.

[1] https://climatereanalyzer.org/clim/sst_daily/

fjfaase··on What Is a Knowledge Graph?
An interesting use of Knowledge Graphs is doing research into historic document, such when doing genealogical research or researching into some historic event, person or location. In those applications, you often have that sources do not have direct references (a person name in one document cannot always be identified with with 100% certainty) or are contradicting each other (one source gives a different date than another). In this case another layer is needed. There is some need for attaching a source identification, the actual document (scans), an author and/or an authority to a source. In case you are extracting information from historical documents, it might be needed to transcribe the contents and in that case it would be nice to be able to mark parts of the text, to quickly verify the source of a fact.

I have not yet found an application that combines all those functions and I have been considering to build one myself.

fjfaase··on 12 Coins in Verse: Genius solution of twelve balls and a scale problem
A long time ago, I wrote a page about various reported solutions for this problem [1]. It must have been around 1978 that I first heard of this puzzle. I am not sure, if I did find the solution by myself. (I just noted that the page contains some dead links.)

[1] https://www.iwriteiam.nl/Ha12coins.html

fjfaase··on [dead]
It seems that many imperative languages make have different types of assignments. C# also treats structs and classes differently with respect to assignment. This not always very transparent differences can lead to some of the nastiest bugs, especially in languages where you cannot easily see that two values 'point' to the same 'object' or are two 'objects' with the same value.

I wonder if it is possible to create a high-level imperative language that makes a clear difference between variables holding a value (possibly very complex with many different components, like lists, sets, trees, maps, and references) and cursors that point to a part of a value in a variable. Such cursors would typically always belong to a value in a variable and can be used to query and also modify the value.

fjfaase··on We may finally know what caused the biggest cosmic explosion ever seen
Scientific article 'A bright megaelectronvolt emission line in γ-ray burst GRB 221009A' on ArXiv: https://arxiv.org/abs/2303.16223
fjfaase··on Tabloid: A clickbait headline programming language (2021)
That is exactly what I did for the 'A practical approach to parsing' workshop I gave at MCH2022 [1]. You can give it a try with the online IParse Studio [2], which has a simple build in interpreter, and if you are lazy or getting stuck, you can have a look at the grammar I wrote myself [3], which does not specify operator precedence yet.

[1] https://fransfaase.github.io/MCH2022ParserWorkshop/

[2] https://fransfaase.github.io/MCH2022ParserWorkshop/IParseStu...

[3] https://github.com/FransFaase/MCH2022ParserWorkshop/blob/mai...

fjfaase··on Things I learned while writing an x86 emulator (2023)
Interesting read. I have a lot of respect for people who develop emulator for x86 processors. It is a complicated processor and from first hand experience I know that developing and debugging emulators for CPU's can be very challenging. In the past year, I spend some time developing a very limited i386 emulator [1] including some system calls for executing the first steps of live-bootstrap [2], primarily to figure out how it is working. I learned a lot about system calls and ELF.

[1] https://github.com/FransFaase/Emulator/

[2] https://github.com/fosslinux/live-bootstrap/

← PreviousPage 12 of 32Next →