Skip to content

Instantly share code, notes, and snippets.

View razetime's full-sized avatar
⤵️
real

Raghu R razetime

⤵️
real
View GitHub Profile
@razetime
razetime / 15-draft.md
Last active January 18, 2024 06:10
chapter 15

Tables and Libraries

ngn/k has a hidden, somewhat secret data structure: the table. Tables are a prominent presence in k7 and k9, the latest versions of K, so ngn/k supports them for that reason.

Tables

A table uses symbols to mark columns, and integer indices to mark rows. Making a table is simple. The first method is flipping a dictionary1:

@razetime
razetime / 17-jan-clang-repl
Last active January 17, 2024 02:43
Polygeist compilation messages
[4268/5624] Linking CXX executable bin/clang-repl
FAILED: bin/clang-repl
: && /usr/bin/c++ -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallt
hrough -Wno-maybe-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-c
olor -fn
This file has been truncated, but you can view the full file.
MainThread: starting '/home/razetime/.opam/default/bin/ocamldep.opt -modules src/compiler/ocs/src/ocs_wrap.ml'
* ocamldep.opt : src/compiler/ocs/src/ocs_wrap.ml
+ /home/razetime/.opam/default/bin/ocamldep.opt -modules src/compiler/ocs/src/ocs_wrap.ml
src/compiler/ocs/src/ocs_wrap.ml: Ocs_error Ocs_types
- exit 0, 0.03 sec
MainThread: starting '/home/razetime/.opam/default/bin/ocamldep.opt -modules src/compiler/ocs/src/ocs_error.ml'
* ocamldep.opt : src/compiler/ocs/src/ocs_error.ml
+ /home/razetime/.opam/default/bin/ocamldep.opt -modules src/compiler/ocs/src/ocs_error.ml
src/compiler/ocs/src/ocs_error.ml:
- exit 0, 0.01 sec
@razetime
razetime / felix.log
Created October 28, 2022 02:35
for issue #175
This file has been truncated, but you can view the full file.
# =========================================================
# generates source code from "src/packages" to various places
# around the repo
# =========================================================
python3 src/tools/flx_iscr.py -q -d "src/packages" build/release
PACKAGE src/packages/exceptions.fdoc
PACKAGE src/packages/recognisers.fdoc
PACKAGE src/packages/py_bytearray.fdoc
PACKAGE src/packages/toolchain.fdoc
PACKAGE src/packages/unique.fdoc
@razetime
razetime / felix_build_err.txt
Created October 26, 2022 07:43
Felix build error on latest commit
$ . buildscript/linuxsetup.sh
$ make
# =========================================================
# generates source code from "src/packages" to various places
# around the repo
# =========================================================
python3 src/tools/flx_iscr.py -q -d "src/packages" build/release
PACKAGE src/packages/exceptions.fdoc
PACKAGE src/packages/recognisers.fdoc
PACKAGE src/packages/py_bytearray.fdoc
@razetime
razetime / LeMane_accepted_proposals.md
Created October 17, 2022 15:27
Let's make an esolang, accepted proposals for a potential impl

: @Deleted User

calling _() might delete the next line of code

[ 11:51 PM ] nailuj :

⍝ Simple BST
jt←↑(2 6) (3 5) (4 0) (0 0) (0 0) (7 8) (0 0) (0 0) ⍝ child nodes
jd← 27 14 10 3 19 35 31 42 ⍝ data
FindJE ← {
(t d)←⍺
s←⍵
1∘{x←⍺⊃d ⋄ n←(1+⍵>x)⊃⍺⌷t ⋄ (⍵=x)∨0=n:⍺ ⋄ n∇⍵}s
}
InsertJE ← {
(t d)←⍺
@razetime
razetime / aplspec.md
Last active October 21, 2022 06:47
APL spec

The language, all names, characters, and incidents portrayed in this production are fictitious. No identification with actual languages (living or deceased), places, buildings, and products is intended or should be inferred.

The language is called APL (asinine programming language), and it will be on the esolangs wiki under APL (esolang), probably mentioned under APL (disambiguation).

Functions are defined using ∇name (⍵,⍺) <stuff here> .. the (⍵,⍺) portion will always remain the same and cannot be changed. Only two arguments can be given to a function. All assignments are by reference.

Primitives

@razetime
razetime / translate.jl
Created April 16, 2022 10:44
translating a circle
# Based on Josh Pullen's translation animation:
# https://twitter.com/PullJosh/status/1453393772314718215
using Javis
using Animations
function ground(args...)
background("white")
sethue("black")
end

K tutorial

Welcome to K. K is an array-based programming language. Although this term may sound new to many programmers, K comes from a lineage of programming languages which date back to the 1960s.

It is the 1960s. Enter APL. APL originally started out as a general math notation, made to standardise the way mathematical expressions can be looked at. With the creation of APL's revolutionary math notation came the realization that it was very effective at describing algorithms, making it very effective with consistently communicating algorithmic, math-oriented thought. This original award winning idea eventually became what is known today as the APL programming language.

Array languages to this day are still a rather niche area, since they are very unlike what people are taught as beginner programmers. Hence, I'd like to request all viewers to maintain an open mind and have fun.

K is an APL-style array language which aims to eliminate many of APL's problems in programming. At a glance, the most noticeabl