codereport / jsource

J Language Source Code. Livestream links ⬇️
https://www.youtube.com/playlist?list=PLVFrD1dmDdvfVhYLU_iKkV67X9XqCJLWe
Other
38 stars 20 forks source link

J: From C to C++20

:warning::warning::warning: THIS PROJECT IS ON PAUSE AT THE MOMENT :warning::warning::warning:

J is an array programming language created by Ken Iverson and Roger Hui (see image below).

This is a fork of jsoftware/jsource and we will be porting it to C++20.

Motivation

The motivation for this is to learn about how Ken Iverson / Roger Hui implemented the J language (and similarly APL as J is the successor to APL). The end goal is to learn as much as possible.

Try J

If you would like to try J without building from source, check out this site: http://tryj.freeddns.org/

Goals

Non-Codebase Goals

Comparison of Languages

Calculating the first 10 odd numbers:

Language Code Runnable Link
J 1+2*i.10 j playground
APL ¯1+2×⍳10 TryAPL
R -1+2*seq(10)
Python [1 + 2 * i for i in range(10)] Godbolt
Haskell map (1+) $ map (2*) [0..9] OneCompiler
Haskell map ((+1) . (*2)) [0..9] OneCompiler
Haskell take 10 [1,3..] OneCompiler
C++ transform(iota(0, 10), [](auto e) { return e * 2 + 1; }) Godbolt
C# Enumerable.Range(0, 10).Select((int i) => { return i * 2 + 1; })
Java IntStream.range(0, 10).map(x -> x * 2 + 1).toArray();
Ruby (0..9).map { \|i\| i * 2 + 1 } Try It Online

Getting started & Building:

For building this repository, please see CONTRIBUTING.md.

Image of Ken Iverson and Roger Hui

image