Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env janet
(def c 299792458)
(defn gamma [v]
(/ 1
(math/sqrt (- 1
(math/pow (/ v c)
2)))))

Building and Running the janet binary

The janet binary is built from a janet.c file, but that file is not present in the Janet repo --- it is generated during the bootstrapping process. That process is described below.

The Janet compiler is written in C, and so you can use gcc (or some other C compiler) to build it, but a substantial number of Janet functions and macros (see src/boot/boot.janet) are implemented in Janet itself.

The "bootstrapper" is the compiled form of boot.c.

#!/usr/bin/env janet
(import jaylib :as jl)
(def screen-width 600)
(def screen-height 300)
(def pl-sz 20)
# Start the player (the square) in the middle of the screen,
# with some known initial velocity.
# For help:
#
# Clojure lexer:
# <https://github.com/pygments/pygments/blob/master/pygments/lexers/jvm.py#L736>
#
# Hy lexer:
# <https://github.com/pygments/pygments/blob/master/pygments/lexers/lisp.py#L346>
#
# Fennel lexer:
# <https://github.com/pygments/pygments/blob/master/pygments/lexers/lisp.py#L2625>

% stuff

hi

  • foo
  • bar
  • baz

and also

package;
import haxe.ui.HaxeUIApp;
import haxe.ui.core.Component;
import haxe.ui.macros.ComponentMacros;
import haxe.ui.components.Button;
import haxe.ui.components.Slider;
import haxe.ui.components.Label;
package;
import hx.widgets.Panel;
import hx.widgets.GraphicsContext;
import hx.widgets.PaintDC;
import hx.widgets.Pen;
import hx.widgets.Brush;
import hx.widgets.StockBrushes;
import hx.widgets.AntialiasMode;
import hx.widgets.EventType;
For complete documentation of this file, please see Geany's main documentation
[styling]
use foreground;background;bold;italic or named_style,bold,italic
used for filetype All/None
#default=default
3rd selection argument is true to override default foreground
4th selection argument is true to override default background
#selection=selection
@uvtc
uvtc / gist:379bca988270ba8b44a30efabbfa9d6b
Last active January 22, 2018 18:45
markdown lists following 4-space rule
Notice how all list content (regardless of list marker)
always starts at column 4, 8, 12,...
* item 1 containing
multiple lines, all of
which nicely align
vertically.
* item 2
@uvtc
uvtc / warnings-installing-inf-clojure
Created May 8, 2017 20:13
Warnings upon installing inf-clojure
Compiling file /home/john/.emacs.d/elpa/inf-clojure-20170507.233/inf-clojure-pkg.el at Mon May 8 14:05:45 2017
Entering directory `/home/john/.emacs.d/elpa/inf-clojure-20170507.233/'
Compiling file /home/john/.emacs.d/elpa/inf-clojure-20170507.233/inf-clojure.el at Mon May 8 14:05:45 2017
In inf-clojure-results-from-process:
inf-clojure.el:943:79:Warning: Use `with-current-buffer' rather than
save-excursion+set-buffer