GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Notices by LR (lritter@mastodon.gamedev.place), page 3

  1. Embed this notice
    LR (lritter@mastodon.gamedev.place)'s status on Friday, 02-May-2025 07:16:31 JST LR LR
    in reply to

    phew. five hours later, i've translated *all types* used by Scopes into this format, from which C++ definitions will be derived.

    what i like particularly here is that all sub-enums like ICmpKind or TypeKind, and even all error codes, are flattened into the main ValueKind one, but can still be their own enumerator types.

    many branch-dependent special cases are now unified this way.

    https://hg.sr.ht/~duangle/scopes/browse/src/Value.sx?rev=based

    #devlog #scopes

    In conversation about 9 months ago from gnusocial.jp permalink
  2. Embed this notice
    LR (lritter@mastodon.gamedev.place)'s status on Friday, 02-May-2025 07:16:30 JST LR LR
    in reply to

    the parser for Value.sx now fully parses the definition file in 455 lines.

    https://hg.sr.ht/~duangle/scopes/raw/lib/scopes/compiler/pilot/gencc.sc?rev=based

    now we need to generate some actual C++ code.

    #devlog #scopes

    In conversation about 9 months ago from mastodon.gamedev.place permalink
  3. Embed this notice
    LR (lritter@mastodon.gamedev.place)'s status on Friday, 02-May-2025 07:16:29 JST LR LR
    in reply to

    we have generated some code. instead of generating plain C++ expressions i employ the same technique i did with the scopes² prototype: generate macro expressions and let the preprocessor translate.

    left is an impression of what the output looks like (header file). right is the file used to translate it to C definitions. most of it is stubs so the code compiles at all.

    #devlog #scopes

    In conversation about 9 months ago from gnusocial.jp permalink

    Attachments


    1. https://cdn.masto.host/mastodongamedevplace/media_attachments/files/114/262/319/846/834/290/original/bf38bc51df656261.png

    2. https://cdn.masto.host/mastodongamedevplace/media_attachments/files/114/262/324/250/109/120/original/4627537e56be3321.png
  4. Embed this notice
    LR (lritter@mastodon.gamedev.place)'s status on Friday, 02-May-2025 07:16:28 JST LR LR
    in reply to

    in full refactoring flow now, as i replace explicit classes with generated types, turn methods into functions, figure out small extensions to the type generator, etc.

    as a result, codebase's getting smaller, which is always a good sign.

    #devlog #scopes

    In conversation about 9 months ago from mastodon.gamedev.place permalink

    Attachments

    1. No result found on File_thumbnail lookup.
      Parked at Loopia
  5. Embed this notice
    LR (lritter@mastodon.gamedev.place)'s status on Friday, 02-May-2025 07:16:27 JST LR LR
    in reply to

    lots of refactoring today. codebase is completely shot. changes everywhere. many deletions. into the rabbit hole i go.

    #devlog #scopes

    In conversation about 9 months ago from gnusocial.jp permalink
  6. Embed this notice
    LR (lritter@mastodon.gamedev.place)'s status on Friday, 02-May-2025 07:16:26 JST LR LR
    in reply to

    voting this the least helpful error message in C++ (it's a bit verbose because i use heavily templated types, and C++ doesn't know when to quit describing nesting structures).

    you get this when you use a type for STL hashmaps that's not supported by std::hash. it doesn't actually tell you where you made that mistake. it does in fact tell you nothing useful aside from the type used. you just have to know by experience.

    #devlog #scopes

    In conversation about 9 months ago from mastodon.gamedev.place permalink

    Attachments


    1. https://cdn.masto.host/mastodongamedevplace/media_attachments/files/114/285/429/455/666/781/original/a33811f6bf5ec425.png
  7. Embed this notice
    LR (lritter@mastodon.gamedev.place)'s status on Friday, 02-May-2025 07:16:25 JST LR LR
    in reply to

    expander.cpp is the first big module to be fully updated, now i'm updating gen_llvm.cpp. it's the mother of all refactorings.

    #devlog #scopes

    In conversation about 9 months ago from gnusocial.jp permalink
  8. Embed this notice
    LR (lritter@mastodon.gamedev.place)'s status on Friday, 02-May-2025 07:16:24 JST LR LR
    in reply to

    gen_llvm.cpp is updated, next is globals.cpp. this one implements the C API wrapper around the C++ parts of the compiler and also exports all API symbols to the client context, which looks like below.

    these 600+ lines of definitions are all manually maintained, but could be autogenerated from scopes.h alone, which i'll implement now.

    #devlog #scopes

    In conversation about 9 months ago from mastodon.gamedev.place permalink

    Attachments


    1. https://cdn.masto.host/mastodongamedevplace/media_attachments/files/114/331/078/916/002/310/original/597bfff8b078f07b.png
  9. Embed this notice
    LR (lritter@mastodon.gamedev.place)'s status on Friday, 02-May-2025 07:16:23 JST LR LR
    in reply to

    de-optimizing Scope objects to speed the refactor along (I have a much better optimization to apply later), and updating related API functions.

    #devlog #scopes

    In conversation about 9 months ago from gnusocial.jp permalink
  10. Embed this notice
    LR (lritter@mastodon.gamedev.place)'s status on Friday, 02-May-2025 07:16:22 JST LR LR
    in reply to

    and now it's time to eat my own dogfood

    #devlog #scopes

    In conversation about 9 months ago from mastodon.gamedev.place permalink

    Attachments


    1. https://cdn.masto.host/mastodongamedevplace/media_attachments/files/114/354/060/344/836/772/original/c1b19f403a2312ea.png
  11. Embed this notice
    LR (lritter@mastodon.gamedev.place)'s status on Friday, 02-May-2025 07:16:21 JST LR LR
    in reply to

    refactoring is intensifying

    #devlog #scopes

    In conversation about 9 months ago from gnusocial.jp permalink

    Attachments


    1. https://cdn.masto.host/mastodongamedevplace/media_attachments/files/114/375/532/508/239/498/original/9586b163f550a73b.png
  12. Embed this notice
    LR (lritter@mastodon.gamedev.place)'s status on Friday, 02-May-2025 07:16:20 JST LR LR
    in reply to

    i'm going to remove all the internal "homebrew exception" stuff from our C++ codebase and use C++ exceptions instead, which drastically simplifies a lot of the error handling code. we're already converting exceptions at the boundaries, this would be no different.

    honestly i no longer understand why i was so reluctant to use this in the first place. i guess i was afraid C++ exception support would leak into the scopes API but those worries were unfounded.

    #devlog #scopes

    In conversation about 9 months ago from mastodon.gamedev.place permalink
  13. Embed this notice
    LR (lritter@mastodon.gamedev.place)'s status on Friday, 02-May-2025 07:16:19 JST LR LR
    in reply to

    wrote some great sugar for the boundary so there's virtually no sweat translating exceptions.

    first pic is old way, second pic is new way

    #devlog #scopes

    In conversation about 9 months ago from gnusocial.jp permalink

    Attachments


    1. https://cdn.masto.host/mastodongamedevplace/media_attachments/files/114/377/211/390/296/002/original/db024bb34932d467.png

    2. https://cdn.masto.host/mastodongamedevplace/media_attachments/files/114/377/217/916/252/051/original/8645806b58ab807a.png
  14. Embed this notice
    LR (lritter@mastodon.gamedev.place)'s status on Friday, 02-May-2025 07:16:18 JST LR LR
    in reply to

    more refactoring. this is the mother of all refactorings. i will probably never get done.

    #devlog #scopes

    In conversation about 9 months ago from mastodon.gamedev.place permalink
  15. Embed this notice
    LR (lritter@mastodon.gamedev.place)'s status on Friday, 02-May-2025 07:16:17 JST LR LR
    in reply to

    getting to list.cpp. the existing implementation uses simple cons cells, and while i want to use something else in the future, i'll keep it as it is right now so we're going to get to working state sooner.

    what i would like to try in the next list impl is "wide cons cells", conceptually immutable arrays broken into multiple singly-linked pieces.

    #devlog #scopes

    In conversation about 9 months ago from gnusocial.jp permalink
  16. Embed this notice
    LR (lritter@mastodon.gamedev.place)'s status on Friday, 02-May-2025 07:16:16 JST LR LR
    in reply to

    lists done, platform ABI done. now we get to prover.cpp which is the typechecker, and at 4500 lines a behemoth, compared to other files.

    i wrote down a few regexes i used for replacement here, which save me a lot busy work.

    #devlog #scopes

    In conversation about 9 months ago from mastodon.gamedev.place permalink

    Attachments


    1. https://cdn.masto.host/mastodongamedevplace/media_attachments/files/114/387/298/460/525/031/original/11cc1691e82873bd.png
  17. Embed this notice
    LR (lritter@mastodon.gamedev.place)'s status on Friday, 02-May-2025 07:16:15 JST LR LR
    in reply to

    still refactoring prover.cpp. for every reported compiler error i see i fix all similar patterns in the file, and yet i am still at line 1703 of 4390 (38%). but through this method, progress should be exponential-- or wait, this pattern matches the one of the sieve of eratosthenes (https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes), so progress should follow the distribution of "new problems" in the file (each problem equivalent to a prime). it's interesting to think about

    #devlog #scopes

    In conversation about 9 months ago from gnusocial.jp permalink

    Attachments

    1. Domain not in remote thumbnail source whitelist: upload.wikimedia.org
      Sieve of Eratosthenes
      In mathematics, the sieve of Eratosthenes is an ancient algorithm for finding all prime numbers up to any given limit. It does so by iteratively marking as composite (i.e., not prime) the multiples of each prime, starting with the first prime number, 2. The multiples of a given prime are generated as a sequence of numbers starting from that prime, with constant difference between them that is equal to that prime. This is the sieve's key distinction from using trial division to sequentially test each candidate number for divisibility by each prime. Once all the multiples of each discovered prime have been marked as composites, the remaining unmarked numbers are primes. The earliest known reference to the sieve (Ancient Greek: κόσκινον Ἐρατοσθένους, kóskinon Eratosthénous) is in Nicomachus of Gerasa's Introduction to Arithmetic, an early 2nd century CE book which attributes it to Eratosthenes of Cyrene, a 3rd century BCE Greek mathematician, though describing the sieving by odd numbers instead of by primes. One of a number of prime number sieves, it is one of the most efficient ways to find all of the smaller primes...
  18. Embed this notice
    LR (lritter@mastodon.gamedev.place)'s status on Friday, 02-May-2025 07:16:12 JST LR LR

    let it be known that i just about now completed the port of prover.cpp

    from here on out it's not so much work left.

    #devlog #scopes

    In conversation about 9 months ago from mastodon.gamedev.place permalink
  19. Embed this notice
    LR (lritter@mastodon.gamedev.place)'s status on Friday, 02-May-2025 07:16:11 JST LR LR
    in reply to

    i'm redoing scope.cpp, implementing the first class lexical scope type that gave the language its name.

    The musings on this turned out a little long, so I put them in a separate text instead: https://git.sr.ht/~duangle/texts/tree/master/item/ponder/scope2025.md

    #devlog #scopes

    In conversation about 9 months ago from gnusocial.jp permalink

    Attachments


  20. Embed this notice
    LR (lritter@mastodon.gamedev.place)'s status on Friday, 02-May-2025 07:16:08 JST LR LR

    did i say 11 sources left? i forgot all the sources in types/*.cpp, so it's 24 sources total. but i did a lot today. 9 sources left.

    #devlog #scopes

    In conversation about 9 months ago from mastodon.gamedev.place permalink
  • After
  • Before

User actions

    LR

    LR

    Account of Leonard Ritter (he/him, they/them). Arts, Maths, Metaprogramming & Nonsense; Game Developer at @duangle. paniq in the demoscene. Building Tukan, a procedural game engine, maintaining Scopes & gently going NowHere.I mostly write in English, rarely in German.Migrated from @paniqMy avatar is the logo of the library I'm working on, a stylized toucan with a four-colored beak.TRAHR✨SPARKLES MEAN SPARKLES✨

    Tags
    • (None)

    Following 0

      Followers 0

        Groups 0

          Statistics

          User ID
          11596
          Member since
          29 Sep 2022
          Notices
          171
          Daily average
          0

          Feeds

          • Atom
          • Help
          • About
          • FAQ
          • TOS
          • Privacy
          • Source
          • Version
          • Contact

          GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

          Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.