blogs.perl.org blogs.perl.org

Perl Weekly Challenge 144: Semiprimes and Ulam Sequence

These are some answers to the Week 144 of the Perl Weekly Challenge organized by Mohammad S. Anwar. Spoiler Alert: This weekly challenge deadline is due in a few days from now (on December 26, 2021 at 24:00). This blog post offers some solutions to this challenge, please don’t read on if you intend to complete the challenge on your own. Task 1: Semiprimes Write a script to generate all Semiprime number <= 100. For more information...

blogs.perl.org blogs.perl.org

Writing a SNES assembler compiler/disassembler - Day 3

Assembling the AssemblerGrammar fixWhen starting implementing the compiler part of this. I noticed that the grammar does not actually really work, especially if you introduce new lines. If I parse a file with 3 instructions, we catch the \n sometime and the asm-comment token is too greedy.Let's change the ws rule to only capture horizontal blank (space and tab) and introduce an eol token, this makes the grammar more clear on what...

blogs.perl.org blogs.perl.org

My Favorite Warnings: syntax

Warnings category syntax contains a number of sub-categories representing possibly-problematic syntax. These include ambiguous syntax, problematic bareword usage, invalid printf conversions, and more. But there are also syntax diagnostics that do not fall under any of the sub-categories. These tend to be a miscellaneous group, and a normal-sized blog post can do no more than to give a sample. What brought this to my attention was a...

blogs.perl.org blogs.perl.org

Perl Weekly Challenge 143: Calculator and Stealthy Numbers

These are some answers to the Week 143 of the Perl Weekly Challenge organized by Mohammad S. Anwar. Spoiler Alert: This weekly challenge deadline is due in a few days from now (on December 19, 2021 at 24:00). This blog post offers some solutions to this challenge, please don’t read on if you intend to complete the challenge on your own. Task 1: Calculator You are given a string, $s, containing mathematical expression. Write a script...

blogs.perl.org blogs.perl.org

A (not so) simple matter of privacy

You may have seen Ovid's recent post on his discussions with the Perl Steering Committee about moving forward with implementing an initial subset of the Corinna proposal in the Perl core. One of the issues that came up during those discussions was the best way to provide private methods in Corinna. The current Corinna proposal is that this would be done (like almost everything else in Corinna) via an attribute: method do_internal...

blogs.perl.org blogs.perl.org

Writing a SNES assembler compiler/disassembler - Day 2

First look at generating grammarsThis will be very short even if that take me a lot of time to figure this part.In my ASM65816Grammar.rakumod I manually wrote the Number and Addressing grammar but obiously for the instructions it's not really possible.General ASM grammarFirst let's focus on parsing something simple.The basic gist of what you can write in an asm file is very short lda $42 clc adc #3 cmp #0005:beq $4855 ; if $42 + 3 is...

blogs.perl.org blogs.perl.org

Writing a SNES assembler compiler/disassembler - Day 1

Writing a SNES assembler compiler/disassemblerWhy ? Because I can. More seriously I have a project where I need to inject new Snes code in a running game and I want to express directly this new code in my Raku component (A webserver service). I want to have special sub that returns me Snes bytecode but that contains Snes assembler.I tried injecting a SLANG in Raku already. Like writing my $byte-code = SNES lda $42; sta $54; rtl; But...

blogs.perl.org blogs.perl.org

Developing A Game Engine with Perl: Part 5 - 32bit -> 64bit & Perl's Storable

If you haven't heard already... I DO NOT KNOW WHAT I AM DOING. If you want to start reading from the beginning. Check out the first article in this series Continuing on with the last article let's talk about changing system architecture and how that can affect Perl code, specifically Storable. Mouse Input SupportHardware FailureServer UpgradeUEFI vs OpenSuSE Installer32bit -> 64bit & Perl's Storable After the old server had HDD...

blogs.perl.org blogs.perl.org

Perl Weekly Challenge 141: Number Divisors and Like Numbers

These are some answers to the Week 141 of the Perl Weekly Challenge organized by Mohammad S. Anwar. Spoiler Alert: This weekly challenge deadline is due in a few days from now (on December 5, 2021 at 24:00). This blog post offers some solutions to this challenge, please don’t read on if you intend to complete the challenge on your own. Task 1: Number Divisors Write a script to find lowest 10 positive integers having exactly 8...

blogs.perl.org blogs.perl.org

Developing A Game Engine with Perl

Perl? What... really? To most in the know, coding a game engine with Perl would be a surprise. I've certainly been asked, "Why Perl?". You see, unlike C++, C#, Java and others, which are well established languages in game engine design, Perl is not (well) known for it's role in the development of games. Especially not as a game engine language. You are much more likely to see Perl managing the network infrastructure for the...