Skip to content

Instantly share code, notes, and snippets.

View pepe's full-sized avatar

Josef Pospíšil pepe

View GitHub Profile
@sogaiu
sogaiu / gist:fd13231e0f239e3b88a8019780f064f4
Created February 3, 2024 13:04
some bits of the jpm man page
NVIRONMENT
JANET_TREE
A convenient way to set the modpath, binpath, syspath, and
manpath all at once. This is equivalent to the --tree parameter
to jpm.
JANET_PATH
The location to look for Janet libraries. This is the only
environment variable Janet needs to find native and source code
modules. If no JANET_PATH is set, Janet will look in the default
@sogaiu
sogaiu / extract.md
Last active February 15, 2024 08:18
extract from "Auditory vs. articulatory training in exotic sounds" a 1970 study by Catford, J. C. Pisoni, David B. (https://files.eric.ed.gov/fulltext/ED042174.pdf)

AUDITORY VS. ARTICULATORY TRAINING IN EXOTIC SOUNDS

J. C. Catford and David E. Pisoni

Center for Research on Language and Language Behavior

The University of Michigan

Two groups of English speakers received either auditory or articulatory instruction in learning to produce exotic sounds.

@sogaiu
sogaiu / what-people-have-used-janet-for.md
Last active March 8, 2023 10:09
some things people have used janet for

pp:

From scripts to quite complex webapps

Ian Henry:

Personally, making games using Jaylib, and compiling to WebAssembly to make websites with embedded scripting. Otherwise, yeah, mostly as a replacement for bash/perl/Python -- https://github.com/andrewchambers/janet-sh makes it strictly better than bash I think.

https://bauble.studio/ and https://toodle.studio/ -- little art playgrounds. I've also written some about my experience making a game in Jaylib here: https://ianthehenry.com/posts/janet-game/

ask not whether janet is a lisp, but rather consider that...
common lisp, clojure, scheme, and others are "hilwalpad"s
what is a "hilwalpad"?
it is a "homo iconic language with at least parens as delimiters"
@sogaiu
sogaiu / gist:d49bb541805934360dc38a7ccc576550
Last active September 22, 2021 06:27
number special and chunked encoding
(let [chunked
# https://en.wikipedia.org/wiki/Chunked_transfer_encoding#Encoded_data
(string "4\r\n"
"Wiki\r\n"
"6\r\n"
"pedia \r\n"
"E\r\n"
"in \r\n"
"\r\n"
"chunks.\r\n"
@sogaiu
sogaiu / jsrc.janet
Last active August 29, 2021 18:58
jsrc
#! /usr/bin/env janet
# jsrc - display source associated with some janet symbol
# thanks to bakpakin and yumaikas
###########################################################################
## requirements ##
@sogaiu
sogaiu / thread-channels-with-supervisor.janet
Last active August 27, 2021 07:25
thread channels with supervisor
# channels that can be used for communication between os threads
(def t-chan-a (ev/thread-chan 10))
(def t-chan-b (ev/thread-chan 10))
# supervisor channel
(def t-sv-chan (ev/thread-chan 10))
# one thread
(ev/thread
(fiber/new
@sogaiu
sogaiu / some-users-of-janet-abstract-type.md
Last active December 18, 2022 17:17
some users of janet abstract type
@subsetpark
subsetpark / interp.c
Last active August 17, 2021 09:58
baby's first Janet C module
#include <janet.h>
// Function to be exported
// Returns a Janet; that's the static value that boxes a dynamic Janet type
// argc: number of arguments it was called with
// argv: arguments array
static Janet interp(int32_t argc, Janet *argv) {
// Assert that argc == 2
janet_fixarity(argc, 2);