Skip to content

Instantly share code, notes, and snippets.

Avatar
🤔
Contemplative.

K Lange klange

🤔
Contemplative.
View GitHub Profile
View gist:15b8d6bb4bb6b291e043817c41a393c1
>>> True or explode()
<<module>() from <stdin>>
1 0 TRUE
1 JUMP_IF_TRUE_OR_POP 4 (to 8)
4 GET_GLOBAL 0 'explode'
6 CALL 0
>> 8 POP
2 9 GET_LOCAL 0
11 RETURN
View anonstruct.c
#include <stdio.h>
struct Base {
int foo;
int bar;
};
struct Sub {
struct Base;
int baz;
View gist:863a7755328c9d4291dccef76e435cd2
Corrupt bytes iterator: %s
corrupt Directory
corrupt enumerate object
Corrupt File
corrupt filter object
Corrupt list iterator: %s
corrupt map object
Corrupt str iterator: %s
View install-bim.sh
wget -O kuroko.zip https://github.com/kuroko-lang/kuroko/archive/master.zip; unzip kuroko.zip
wget -O bim.zip https://github.com/klange/bim/archive/master.zip; unzip bim.zip
pushd kuroko-master
make CFLAGS="-std=gnu99 -O3"
sudo make install prefix=/usr libdir=/usr/lib64
popd
kuroko --version
pushd bim-master
make
sudo make install
@klange
klange / sandbox.c
Created Jan 31, 2021
Kuroko Sandbox Demo
View sandbox.c
#include <stdio.h>
#include "src/vm.h"
#define S(c) (krk_copyString(c,sizeof(c)-1))
int main(int argc, char * argv[]) {
if (argc < 2) {
fprintf(stderr, "expected a string to evaluate\n");
return 1;
}
View gist:6ef2e320dce56bd048da860e64201ed8
>>> l[1]++
| [ *<closure <def <module>>> ]
0000 1 OP_GET_GLOBAL 0 '"l"' (type=String)
| [ *<closure <def <module>>> ][ <instance of list> ]
0002 | OP_DUP 0
| [ *<closure <def <module>>> ][ <instance of list> ][ <instance of list> ]
0004 | OP_CONSTANT 1 '1' (type=Integer)
| [ *<closure <def <module>>> ][ <instance of list> ][ <instance of list> ][ 1 ]
0006 | OP_SWAP 1
| [ *<closure <def <module>>> ][ <instance of list> ][ 1 ][ <instance of list> ]
View gist:87849cfa2e8dc0f47e4d6a52a09a4066
Name: K. Lange
Email: klange (at) toaruos (dot) org
Subject: Re: "Way, Way Outside!"
Your recent article titled "Linux and the Multiverse", published in the January 2019 issue, featured a subsection "Way, Way Outside!" about PonyOS. It is always an honor to see my creations featured in media publications, especially in print form. As I say on my website, and as Marcel reiterates in the article (though perhaps with a tone that may not convey sincerity), PonyOS is not a Linux distribution - its kernel and core applications instead deriving from my real hobby OS project (ToaruOS), where they were written from scratch by myself and a handful of contributors over nearly a decade. PonyOS is, of course, a joke - a special release, updated once a year on an equally special day. As it's been several months since the last April Fools, much has happened in the upstream project, and as such the latest release of PonyOS is a sort of time capsule, capturing a bygone era for both projects - rather nostalgic to me! PonyOS a
@klange
klange / double_free.txt
Created Dec 12, 2018
ToaruOS memory tracker examples
View double_free.txt
Double free detected: 0x174ca10 (allocated by 0x3de14f)
Double free detected: 0x174ca10 (allocated by 0x3de14f)
Double free detected: 0x174ca10 (allocated by 0x3de14f)
Double free detected: 0x174ca10 (allocated by 0x3de14f)
Double free detected: 0x174ca10 (allocated by 0x3de14f)
Double free detected: 0x174ca10 (allocated by 0x3de14f)
Double free detected: 0x174ca10 (allocated by 0x3de14f)
Double free detected: 0x174ca10 (allocated by 0x3de14f)
Double free detected: 0x174ca10 (allocated by 0x3de14f)
Double free detected: 0x174ca10 (allocated by 0x3de14f)
View gist:87760bc636114329794f4a5018eb98af
local@livecd /usr/out$ ./open-mkstemp-rdonly [11/22 16:23:47]
local@livecd /usr/out$ ./open-mkstemp-rdonly-trunc [11/22 16:23:50]
open: EINVAL
local@livecd 1 /usr/out$ ./open-tmpdir-rdonly [11/22 16:23:52]
local@livecd /usr/out$ ./open-tmpdir-rdonly-append [11/22 16:24:00]
local@livecd /usr/out$ ./open-tmpdir-rdonly-creat [11/22 16:24:03]
open: EISDIR
local@livecd 1 /usr/out$ ./open-tmpdir-rdonly-trunc [11/22 16:24:09]
open: EINVAL
local@livecd 1 /usr/out$ ./open-tmpdir-rdwr [11/22 16:24:19]
View gist:97aa37f046d057780de741ead206e443
local@livecd ~$ sudo msk update [11/07 13:53:08]
[sudo] password for local:
local@livecd ~$ sudo msk install src src-tools [11/07 13:54:01]
The following packages will be installed:
zlib ungz src python gcc binutils build-essential src-tools
Continue? [Y/n] y
Install 'zlib'...
Install 'ungz'...
Install 'src'...
Install 'python'...