diff --git a/2024/2024.tar.bz2 b/2024/2024.tar.bz2 index da4e17619..6067e2ed4 100644 Binary files a/2024/2024.tar.bz2 and b/2024/2024.tar.bz2 differ diff --git a/2024/ferguson1/2024_ferguson1.tar.bz2 b/2024/ferguson1/2024_ferguson1.tar.bz2 index 4c87b4f15..16b309e67 100644 Binary files a/2024/ferguson1/2024_ferguson1.tar.bz2 and b/2024/ferguson1/2024_ferguson1.tar.bz2 differ diff --git a/2024/maffiodo/2024_maffiodo.tar.bz2 b/2024/maffiodo/2024_maffiodo.tar.bz2 index 532da0058..0d46230d0 100644 Binary files a/2024/maffiodo/2024_maffiodo.tar.bz2 and b/2024/maffiodo/2024_maffiodo.tar.bz2 differ diff --git a/2024/maffiodo/README.md b/2024/maffiodo/README.md index f5f784212..8e47175f5 100644 --- a/2024/maffiodo/README.md +++ b/2024/maffiodo/README.md @@ -34,7 +34,7 @@ Can you write one in the implemented subset of the language? #### What's this? -Jav*script interpreter with Object, Array, String, Number, Functions and +Jav\*script interpreter with Object, Array, String, Number, Functions and Garbage Collector. Batteries are not included. @@ -93,7 +93,7 @@ Included files via Makefile (to reduce number of tokens, lower than 5006/2): ### Features Supported and unsupported features (everything else that is not listed is -probaly unsupported, but who knows...): +probably unsupported, but who knows...): - supported binary operators (in execution priority order from lower to higher);
, = == != & &= && | |= || > >= >> < <= << - -= + += * \*= / /= % %= [ ( .
@@ -171,7 +171,7 @@ probaly unsupported, but who knows...): - **only** single line comments are supported - multi line comments are not supported. Use only single line comments - any unary operator on String value will convert String to Number -- NaN is not implemented so invalid number convertion will generate a 0 Number +- NaN is not implemented so invalid number conversion will generate a 0 Number - division by zero is not handled - there is no error handling, so if something goes wrong, interpreter will crash. If some of the unsupported language features are used, parser will @@ -199,9 +199,9 @@ probaly unsupported, but who knows...): - **length** on String variables (or literal) return the number of characters in the string - there is no slice or splice in String and Array (but these feature can be - partially implemented in plain Javascript -- see **Useful things** chapter) + partially implemented in plain JavaScript -- see **Useful things** chapter) - there is no Date RegEx or Math (but some of Math methods can be implemented - in plain Javascript) + in plain JavaScript) - subscript operation like ``` @@ -228,15 +228,19 @@ probaly unsupported, but who knows...): ``` but something different will happen when you perform some comparisons: + * null == 0 will be equal to 1 * undefined == 0 will be equal to 1 * undefined == null will be equal to 0 * null == {} will be false (correctly) * ... some other edge cases, can you spot them? -- there is not **typeof** or **instanceof**. You need to know the types of your + +- there is no `typeof` nor `instanceof`. You need to know the types of your variables or track its type inside other data structures. -- **this** is missing. Inside Function you need to remember *this* -- **function** declaration is supported ONLY inside expression and not as a + +- `this` is missing. Inside Function you need to remember `this`. + +- Function declaration is supported ONLY inside expression and not as a standalone declarator, so instead of this: ``` @@ -249,7 +253,7 @@ probaly unsupported, but who knows...): var x = function () {}; ``` - and please look at the final semicolon! It is very important beacuse every + and please look at the final semicolon! It is very important because every expression need to terminate with that and without that strange parsing things will happen (also probably some segmentation fault). Functions need to be unnamed by itself. @@ -303,10 +307,10 @@ probaly unsupported, but who knows...): because internally **arguments** array will be re-declared locally, with a stack based approach, for the next function call and can cause some variable - resolving missmatch. This is a little annoying but is also better to always + resolving mismatch. This is a little annoying but is also better to always remap each arguments value to a dedicated local variable. - early exit inside logical expression is not implemented so this code will not - be interrupted before the execution of the foo2 function: + be interrupted before the execution of the `foo2` function: ``` if (0 && foo2(123)) { print("hello\n"); } @@ -442,11 +446,11 @@ The interpreter uses the same struct to hold values and variables. The same struct (c) is also used to store a linked list for global variables and a linked list for all properties contained inside a variable. -Using the same struct has been usefull to strip down the code for a lesser number +Using the same struct has been useful to strip down the code for a lesser number of tokens. This is a semi obfuscated struct that holds variables or values (NOTE: obfuscated -symbols can be slightly differents from the final obfuscated ones): +symbols can be slightly different from the final obfuscated ones): ``` typedef struct c*d; @@ -469,10 +473,10 @@ symbols can be slightly differents from the final obfuscated ones): ``` This struct is huge! It uses 72 bytes on 64bit X86 architecture. This struct is -big to fit all the usefull data inside it and also something else that is +big to fit all the useful data inside it and also something else that is needed to compress the code. In theory can be much smaller but the final code will uses more tokens (I have tried multiple times to implement this interpreter -but this is the only solution that i've found to match the 2503 limitation.. with +but this is the only solution that I've found to match the 2503 limitation.. with the previous limit of 2053 was really hard to stay under the limits -- for me!). Keep in mind also that on 64bit X86 architecture each pointer cost 8 bytes... @@ -640,7 +644,7 @@ Strange things can happen or can be found when using this interpreter: - many other unknown strange things can happen in Hawkins, Indiana... -### Usefull Things +### Useful Things Console prototype is not implemented but console.log can be implemented using only native **print** function. The following is an example of Console @@ -1146,7 +1150,7 @@ been stripped down in the final (light) obfuscated version of the code* atmp[0 + 1];", 20); ``` -Some of these tests has also been ported in plain javascript; take a look inside +Some of these tests has also been ported in plain JavaScript; take a look inside the **verify.js** script. These tests uses **eval()** function to execute a test source code string and verify its execution results. These other tests can be executed with this command: @@ -1181,16 +1185,16 @@ little mambo jumbo interpreter: ### Final Thoughts I've tried multiple time to rewrite this interpreter and compress the final -obfuscated sourcecode to match the previous IOCCC limit but without success. +obfuscated source code to match the previous IOCCC limit but without success. The increased limitation of tokens from 2053 to 2503 has made possible to use this iteration of the interpreter without continue to retry to rewrite that to -compress the final sourcecode. Probably with more iterations the 2053 limit +compress the final source code. Probably with more iterations the 2053 limit should be reached, who knows. The most tricky part in the development process has been to find out a minimal -barebone subset of Javascript features, small enought to allow to build some -other standard features on top of the barebone interpreter. +bare bones subset of JavaScript features, small enough to allow to build some +other standard features on top of the bare bones interpreter. In many tests I've tried to include the Object.keys features (to obtain the list of property keys inside a given Object) but, in all of my attempts, the diff --git a/2024/maffiodo/index.html b/2024/maffiodo/index.html index 16eea19e3..13b79c326 100644 --- a/2024/maffiodo/index.html +++ b/2024/maffiodo/index.html @@ -25,14 +25,14 @@ - - + + - - - + + + @@ -447,7 +447,7 @@ C code Makefile Inventory - ✓ + ✓ @@ -533,7 +533,7 @@ declared without a full prototype

Features

Supported and unsupported features (everything else that is not listed is -probaly unsupported, but who knows…):

+probably unsupported, but who knows…):

    x[1]
@@ -646,21 +646,23 @@ value. This is not true in this mini nano tiny puppy ugly interpreter - null and undefined are not implemented but can be declared like this:

    var null = {};
     var undefined = {};
-

but something different will happen when you perform some comparisons: -* null == 0 will be equal to 1 -* undefined == 0 will be equal to 1 -* undefined == null will be equal to 0 -* null == {} will be false (correctly) -* … some other edge cases, can you spot them? -- there is not typeof or instanceof. You need to know the types of your -variables or track its type inside other data structures. -- this is missing. Inside Function you need to remember this -- function declaration is supported ONLY inside expression and not as a -standalone declarator, so instead of this:

+

but something different will happen when you perform some comparisons:

+
    function x() {}

write this:

    var x = function () {};
-

and please look at the final semicolon! It is very important beacuse every +

and please look at the final semicolon! It is very important because every expression need to terminate with that and without that strange parsing things will happen (also probably some segmentation fault). Functions need to be unnamed by itself. @@ -696,10 +698,10 @@ instead of this: };

because internally arguments array will be re-declared locally, with a stack based approach, for the next function call and can cause some variable -resolving missmatch. This is a little annoying but is also better to always +resolving mismatch. This is a little annoying but is also better to always remap each arguments value to a dedicated local variable. - early exit inside logical expression is not implemented so this code will not -be interrupted before the execution of the foo2 function:

+be interrupted before the execution of the foo2 function:

    if (0 && foo2(123)) { print("hello\n"); }

and this is clearly not standard (in ECMA, Yes you can) - accessing properties on literal String or Number is not supported; For @@ -809,10 +811,10 @@ tests chapter):

The interpreter uses the same struct to hold values and variables. The same struct (c) is also used to store a linked list for global variables and a linked list for all properties contained inside a variable.

-

Using the same struct has been usefull to strip down the code for a lesser number +

Using the same struct has been useful to strip down the code for a lesser number of tokens.

This is a semi obfuscated struct that holds variables or values (NOTE: obfuscated -symbols can be slightly differents from the final obfuscated ones):

+symbols can be slightly different from the final obfuscated ones):

    typedef struct c*d;
     struct c{
       union{
@@ -831,10 +833,10 @@ symbols can be slightly differents from the final obfuscated ones):

int r; // array length / properties length } ;

This struct is huge! It uses 72 bytes on 64bit X86 architecture. This struct is -big to fit all the usefull data inside it and also something else that is +big to fit all the useful data inside it and also something else that is needed to compress the code. In theory can be much smaller but the final code will uses more tokens (I have tried multiple times to implement this interpreter -but this is the only solution that i’ve found to match the 2503 limitation.. with +but this is the only solution that I’ve found to match the 2503 limitation.. with the previous limit of 2053 was really hard to stay under the limits – for me!). Keep in mind also that on 64bit X86 architecture each pointer cost 8 bytes…

The interpreter uses a large amount of RAM, creating many temporary values @@ -950,7 +952,7 @@ instead

and this will work like var has been typed one time. Can you find out where this has been allowed inside the source code? (hint: goto) - many other unknown strange things can happen in Hawkins, Indiana…

-

Usefull Things

+

Useful Things

Console prototype is not implemented but console.log can be implemented using only native print function. The following is an example of Console implementation (found also inside console.js file):

@@ -1412,7 +1414,7 @@ been stripped down in the final (light) obfuscated version of the code

atmp[0] = 10; \ atmp[1] = 20; \ atmp[0 + 1];", 20); -

Some of these tests has also been ported in plain javascript; take a look inside +

Some of these tests has also been ported in plain JavaScript; take a look inside the verify.js script. These tests uses eval() function to execute a test source code string and verify its execution results. These other tests can be executed with this command:

@@ -1439,14 +1441,14 @@ Collector cannot recognize this kind of structure

Final Thoughts

I’ve tried multiple time to rewrite this interpreter and compress the final -obfuscated sourcecode to match the previous IOCCC limit but without success.

+obfuscated source code to match the previous IOCCC limit but without success.

The increased limitation of tokens from 2053 to 2503 has made possible to use this iteration of the interpreter without continue to retry to rewrite that to -compress the final sourcecode. Probably with more iterations the 2053 limit +compress the final source code. Probably with more iterations the 2053 limit should be reached, who knows.

The most tricky part in the development process has been to find out a minimal -barebone subset of Javascript features, small enought to allow to build some -other standard features on top of the barebone interpreter.

+bare bones subset of JavaScript features, small enough to allow to build some +other standard features on top of the bare bones interpreter.

In many tests I’ve tried to include the Object.keys features (to obtain the list of property keys inside a given Object) but, in all of my attempts, the limitation on tokens count was exceeded. With Object.keys would have been @@ -1568,7 +1570,7 @@ Jump to: top

Coda

- Nu HTML check this web page
+ Nu HTML check this web page
Jump to top Jump to Content Jump to Inventory

diff --git a/sitemap.xml b/sitemap.xml index b41eeb212..d90bdaa53 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -14270,7 +14270,7 @@ https://www.ioccc.org/2024/2024.tar.bz2 - 2025-08-03T02:31:11+00:00 + 2025-08-03T03:17:16+00:00 https://www.ioccc.org/2024/anders/2024_anders.tar.bz2 @@ -14742,7 +14742,7 @@ https://www.ioccc.org/2024/ferguson1/2024_ferguson1.tar.bz2 - 2025-08-03T02:30:56+00:00 + 2025-08-03T03:17:03+00:00 https://www.ioccc.org/2024/ferguson1/addpadding.c @@ -14770,15 +14770,15 @@ https://www.ioccc.org/2024/ferguson1/data.asc.src - 2025-07-05T06:08:05+00:00 + 2025-08-03T03:03:49+00:00 https://www.ioccc.org/2024/ferguson1/data.scrnshot.src - 2025-07-05T06:08:05+00:00 + 2025-08-03T03:03:49+00:00 https://www.ioccc.org/2024/ferguson1/data.src - 2025-07-05T06:08:05+00:00 + 2025-08-03T03:03:49+00:00 https://www.ioccc.org/2024/ferguson1/deobfuscation.html @@ -14798,7 +14798,7 @@ https://www.ioccc.org/2024/ferguson1/index.html - 2025-07-26T20:39:36+00:00 + 2025-08-03T03:03:49+00:00 https://www.ioccc.org/2024/ferguson1/ioccc.jpg @@ -14810,7 +14810,7 @@ https://www.ioccc.org/2024/ferguson1/makedata.sh - 2025-07-05T06:08:05+00:00 + 2025-08-03T03:03:49+00:00 https://www.ioccc.org/2024/ferguson1/Makefile @@ -14846,7 +14846,7 @@ https://www.ioccc.org/2024/ferguson1/README.md - 2025-07-22T16:09:02+00:00 + 2025-08-03T03:03:49+00:00 https://www.ioccc.org/2024/ferguson1/spaghetti.png @@ -14854,15 +14854,15 @@ https://www.ioccc.org/2024/ferguson1/strings.asc.loc.txt - 2025-07-12T17:44:42+00:00 + 2025-08-03T03:03:49+00:00 https://www.ioccc.org/2024/ferguson1/strings.loc.txt - 2025-07-12T17:44:42+00:00 + 2025-08-03T03:03:49+00:00 https://www.ioccc.org/2024/ferguson1/strings.scrnshot.loc.txt - 2025-07-12T17:44:42+00:00 + 2025-08-03T03:03:49+00:00 https://www.ioccc.org/2024/ferguson1/travelguide.jpg @@ -15214,7 +15214,7 @@ https://www.ioccc.org/2024/maffiodo/2024_maffiodo.tar.bz2 - 2025-08-01T19:41:25+00:00 + 2025-08-03T03:17:04+00:00 https://www.ioccc.org/2024/maffiodo/array.js @@ -15234,7 +15234,7 @@ https://www.ioccc.org/2024/maffiodo/index.html - 2025-07-26T20:39:52+00:00 + 2025-08-03T03:08:08+00:00 https://www.ioccc.org/2024/maffiodo/Makefile @@ -15254,7 +15254,7 @@ https://www.ioccc.org/2024/maffiodo/README.md - 2025-07-12T17:44:42+00:00 + 2025-08-03T03:06:58+00:00 https://www.ioccc.org/2024/maffiodo/string.js @@ -16918,7 +16918,7 @@ https://www.ioccc.org/status.html - 2025-08-03T02:36:53+00:00 + 2025-08-03T03:12:26+00:00 https://www.ioccc.org/status.json