101010.pl is one of the many independent Mastodon servers you can use to participate in the fediverse.
101010.pl czyli najstarszy polski serwer Mastodon. Posiadamy wpisy do 2048 znaków.

Server stats:

481
active users

#quiche

0 posts0 participants0 posts today
Bread80<p>Sub-ranges feel like quite an obscure feature of a language. But in Pascal they're an essential part of arrays<br>array ['a'..'z'] of Integer<br>So I'm filling out their implementation before I continue with arrays. The next step is the assignment validation when range checking is on.</p><p><a href="https://mstdn.social/tags/quiche" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>quiche</span></a> <a href="https://mstdn.social/tags/quichelang" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>quichelang</span></a> <a href="https://mstdn.social/tags/pascal" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pascal</span></a> <a href="https://mstdn.social/tags/compiler" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>compiler</span></a> <a href="https://mstdn.social/tags/z80" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>z80</span></a> <a href="https://mstdn.social/tags/delphi" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>delphi</span></a></p>
Herr Grün kocht<p>Die Herr Grün Schnittlauchquiche - ganz einfach </p><p>Weil ich doch weiß, dass es drei Tage sind, für die ihr kochen müsst:-) Und das Wetter ist ja auch nicht so pfingstlich. </p><p><a href="https://www.herrgruenkocht.de/vegetarische-quiche/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://www.</span><span class="ellipsis">herrgruenkocht.de/vegetarische</span><span class="invisible">-quiche/</span></a></p><p><a href="https://mstdn.social/tags/Quiche" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Quiche</span></a> <a href="https://mstdn.social/tags/Schnittlauch" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Schnittlauch</span></a> <a href="https://mstdn.social/tags/HerrGruenkocht" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>HerrGruenkocht</span></a> <a href="https://mstdn.social/tags/vegetarisch" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>vegetarisch</span></a> <a href="https://mstdn.social/tags/Pfingsten" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Pfingsten</span></a></p>
Bread80<p>Before I got sidetracked into the type system I was working to get the command line compiler fully up and running.</p><p>The sticking point was command line arguments. I tried using <a href="https://mstdn.social/tags/FreePascal" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>FreePascal</span></a>'s built in parser but it didn't have the flexibility I needed. I've now written something which does and I can now set the platform and deployment options.</p><p><a href="https://mstdn.social/tags/quiche" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>quiche</span></a> <a href="https://mstdn.social/tags/quichelang" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>quichelang</span></a> <a href="https://mstdn.social/tags/compiler" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>compiler</span></a> <a href="https://mstdn.social/tags/pascal" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pascal</span></a> <a href="https://mstdn.social/tags/z80" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>z80</span></a></p><p>1/n</p>
Bread80<p>And writing to an array element. As before the index expression is parsed and an AddrOf operation added to the IL code, which generates the address to write to. Then the right hand side expression is parsed, and a PtrStore operation added to write the data to the address.</p><p><a href="https://mstdn.social/tags/quiche" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>quiche</span></a> <a href="https://mstdn.social/tags/compiler" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>compiler</span></a> <a href="https://mstdn.social/tags/z80" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>z80</span></a> <a href="https://mstdn.social/tags/pascal" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pascal</span></a></p>
Bread80<p>Moving towards array references in <a href="https://mstdn.social/tags/Quiche" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Quiche</span></a>. This code uses an index literal, an index variable, and an index expression.</p><p>A ParseArrayIndex function generates IL for the expression (if any), then an AddrOf operation which takes the array variable and index and returns a pointer to the data.</p><p>The a PtrLoad operation loads the data and stores to a variable.</p><p>There's no bounds validation or code yet, and only code generation for the literal case so far.</p><p><a href="https://mstdn.social/tags/compiler" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>compiler</span></a> <a href="https://mstdn.social/tags/Z80" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Z80</span></a> <a href="https://mstdn.social/tags/Pascal" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Pascal</span></a></p>
Bread80<p>I moving on to start implementing user types in the <a href="https://mstdn.social/tags/Quiche" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Quiche</span></a> <a href="https://mstdn.social/tags/compiler" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>compiler</span></a>. I figure the most useful type to have is arrays and, by implication, strings. Arrays boil down to typed pointers internally so I'm starting with the pointer stuff.</p><p>This now works to assign the address of a variable to a typed pointer, and to instantiate a variable to assign that pointers value to. The PI variable is to test that assigning a ^Byte to it fails (which it does).</p><p><a href="https://mstdn.social/tags/Z80" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Z80</span></a></p>
Bread80<p>Adding array definitions to the <a href="https://mstdn.social/tags/Quiche" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Quiche</span></a> <a href="https://mstdn.social/tags/Compiler" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Compiler</span></a></p><p>An array boils down to a bounds and an element type. For multidimensional arrays the 'inner' element type is itself an array definition.</p><p>The parser for this works recursively which gives an elegantly simple solution (although the actual code is a little gnarly given the syntaxes). Parsing the bounds is parsing a type definition (of a suitable enumerable type). Parsing the element type means parsing another array definition.</p>
Bread80<p>And that's the self tests for enumeration declarations passing.</p><p><a href="https://mstdn.social/tags/quiche" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>quiche</span></a> <a href="https://mstdn.social/tags/compiler" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>compiler</span></a> <a href="https://mstdn.social/tags/z80" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>z80</span></a></p>
Bread80<p>I'm making a start on user types in the compiler. Basic type synonyms and typed pointers can now be declared. I want to work on the declarations code and data structures first, so I can't yet instantiate these types but can use them in other type declarations.</p><p><a href="https://mstdn.social/tags/Quiche" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Quiche</span></a> <a href="https://mstdn.social/tags/Pascal" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Pascal</span></a> <a href="https://mstdn.social/tags/Compiler" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Compiler</span></a> <a href="https://mstdn.social/tags/Z80" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Z80</span></a> <a href="https://mstdn.social/tags/Delphi" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Delphi</span></a></p>
Ralf O‘Beck<p>Meine iOS-App-Empfehlungen:<br>Mastodon-Client: <a href="https://norden.social/tags/Mona" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Mona</span></a><br>Browser: <a href="https://norden.social/tags/iCab" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>iCab</span></a> Mobile oder <a href="https://norden.social/tags/Quiche" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Quiche</span></a><br>RSS-Reader: <a href="https://norden.social/tags/RSSRadio" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>RSSRadio</span></a></p>
Bread80<p>I now have a command line compiler compiling under Lazarus/Free Pascal. That will allow it to run on numerous platforms and, probably, makes it easier for anyone to build themselves.</p><p>The work was pretty straightforward once I found the compatibility mode first Delphi syntax. The other changes were for code which manipulates file paths, where the libraries have diverged somewhat.</p><p>I’m now tweaking the directory structure and relevant code.</p><p><a href="https://mstdn.social/tags/Quiche" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Quiche</span></a> <a href="https://mstdn.social/tags/compiler" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>compiler</span></a> <a href="https://mstdn.social/tags/z80" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>z80</span></a></p>
Bread80<p>I'm not really bothered about REPEAT ... UNTIL loops right now, but I figured it was worth adding them while the WHILE loop code was in by head. So I've added them. And it only took about an hour.</p><p><a href="https://mstdn.social/tags/Quiche" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Quiche</span></a> <a href="https://mstdn.social/tags/compiler" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>compiler</span></a> <a href="https://mstdn.social/tags/Z80" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Z80</span></a></p>
Bread80<p>And that completes WHILE loops:<br>* Fixed a bug with phi node generation.<br>* Write self-tests<br>* Fixed an unrelated bug which allowed intrinsic identifiers to be parsed as infix operators (which caused the compiler to barf and error but not the correct one).</p><p><a href="https://mstdn.social/tags/quiche" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>quiche</span></a> <a href="https://mstdn.social/tags/compiler" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>compiler</span></a> <a href="https://mstdn.social/tags/z80" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>z80</span></a></p>
Bread80<p>I remembered that the Amstrad has a powerful set of print control codes which can set screen mode, cursor location, ink number and palette colours. Now Quiche can output strings I'm having some fun with palette switching. A still image doesn't really do this justice.</p><p><a href="https://mstdn.social/tags/quiche" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>quiche</span></a> <a href="https://mstdn.social/tags/pascal" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pascal</span></a> <a href="https://mstdn.social/tags/compiler" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>compiler</span></a> <a href="https://mstdn.social/tags/Z80" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Z80</span></a></p>
Bread80<p>And some sanitisation of the output string to stop the assembler barfing.</p><p>(The first item on the highlighted line (15) is the string length).</p><p><a href="https://mstdn.social/tags/Quiche" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Quiche</span></a></p>
Bread80<p>Adding support for string constants. The concatenation is purely compile time. (String variables will require a /lot/ more work). Next up is a Write function for strings.</p><p>This is the first type which will only be referenced with pointers (as opposed to the variable containing the actual value itself) so it's something of a tester for how things will work. It also requires support for typed constant data and generating the assembly for them.</p><p><a href="https://mstdn.social/tags/Quiche" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Quiche</span></a> <a href="https://mstdn.social/tags/compiler" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>compiler</span></a> <a href="https://mstdn.social/tags/Z80" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Z80</span></a></p>
Bread80<p>Making some improvements to the tracking of CPU state and I can now optimise away the test before the jump.</p><p>Ideally it would use the carry flag as returned by the call. The challenge is that the current register allocator only looks at the current operation and it needs to allocate something, and it knows a boolean can be converted to zero flag easier than boolean to carry flag, so it expects the value in zero flag.</p><p>Any better will need a better register allocator.</p><p><a href="https://mstdn.social/tags/Quiche" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Quiche</span></a></p>
Bread80<p>You can also store the value to a variable but the code generation is a lot less optimised. However, it could be better. Line 37 of the assembly shows the CPU state after the call. ZF and CF are showing as corrupted but they actually both contain the value returned by the call - ZF set by the SBC A,A, and CF unchanged by the SBC A,A.</p><p><a href="https://mstdn.social/tags/Quiche" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Quiche</span></a></p>
Bread80<p>My first time testing this feature in Quiche and I'm genuinely surprised it works! The code is calling a firmware routine which returns a value in the carry flag. Quiche is able to process that return value and generate a conditional jump using the flag value directly.</p><p>Obviously flag values are easily trashed so there's more testing needed, but I've overjoyed this works!</p><p><a href="https://mstdn.social/tags/Quiche" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Quiche</span></a> <a href="https://mstdn.social/tags/Pascal" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Pascal</span></a> <a href="https://mstdn.social/tags/Compiler" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Compiler</span></a> <a href="https://mstdn.social/tags/Z80" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Z80</span></a></p>
Bread80<p>I'm moving meta data about code Fragments to the Fragments file itself. This feels much more maintainable than putting it in the Primitives CSV. Also better normalised as the same fragment can be used by multiple primitives.</p><p>I pondered the format here for a while before deciding upon a '-' prefix, then realised it's very much like command line argument format, which I like.</p><p>Accurate data about what register state gets corrupted will massively help the code generator.</p><p><a href="https://mstdn.social/tags/Quiche" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Quiche</span></a> <a href="https://mstdn.social/tags/Pascal" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Pascal</span></a> <a href="https://mstdn.social/tags/Compiler" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Compiler</span></a></p>