diff --git a/docs/CNAME b/docs/CNAME new file mode 100644 index 0000000..59a2cbb --- /dev/null +++ b/docs/CNAME @@ -0,0 +1 @@ +jamlang.org diff --git a/docs/Gemfile b/docs/Gemfile new file mode 100644 index 0000000..89d4588 --- /dev/null +++ b/docs/Gemfile @@ -0,0 +1,8 @@ +source "https://rubygems.org" + +gem "jekyll", "~> 4.4" +gem "webrick" # Required for Ruby 3+ + +group :jekyll_plugins do + gem "jekyll-seo-tag" +end diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..ae00688 --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,13 @@ +.PHONY: run install clean + +# Default target: serve the site locally with live reload. +run: + bundle exec jekyll serve --livereload + +# Install Ruby gems listed in Gemfile. +install: + bundle install + +# Wipe the generated _site directory. +clean: + rm -rf _site diff --git a/docs/REFERENCE.md b/docs/REFERENCE.md index 01366ef..bb017db 100644 --- a/docs/REFERENCE.md +++ b/docs/REFERENCE.md @@ -1,259 +1,820 @@ -# The Jam Programming Language Reference +--- +layout: docs +title: Language Reference +permalink: /soon/reference/ +sidebar: + - title: Basics + items: + - name: Variables & Constants + url: "#variables" + - name: Integer Types + url: "#types" + - name: Booleans + url: "#bool" + - name: Strings + url: "#strings" + - name: Pointers & Slices + url: "#pointers" + - name: Arrays + url: "#arrays" + - title: Control & Functions + items: + - name: Control Flow + url: "#control-flow" + - name: Functions + url: "#fn-declaration" + - name: Type Casts + url: "#casts" + - title: Types + items: + - name: Structs + url: "#structs" + - name: Enums + url: "#enums" + - name: Unions + url: "#unions" + - name: Pattern Matching + url: "#match" + - name: Generics + url: "#generics" + - title: System + items: + - name: Modules & Imports + url: "#imports" + - name: Comptime Intrinsics + url: "#intrinsics" + - name: extern / FFI + url: "#extern" + - title: Mutable Value Semantics + items: + - name: Overview + url: "#mvs-overview" + - name: Parameter Modes + url: "#mvs-modes" + - name: Exclusivity + url: "#mvs-exclusivity" + - name: Drop + url: "#mvs-drop" +--- -**Version 0.1.0 — Working Draft** +
+ Jam is a statically typed systems language with mutable value semantics, generics + over types, tagged unions, and an LLVM backend. The compiler infers types where it + can; everything across a function boundary is fully explicit. +
+
+ Use unsigned types (u8, u16, etc.) for values that are never negative — indices, counts, byte sizes.
+ Use signed types (i8, i16, etc.) when you need to represent negative values.
+
*T
+ The mutability qualifier is part of the pointer type — there is no shorthand
+ *T. Writing *const u8
+ vs *mut u8 documents intent at every signature.
+
+ A function with no declared return type returns nothing. Don't write
+ void — just omit the return-type slot.
+
{{ include.content }}
+
+ High performance, ergonomic and safe.
++ High performance, ergonomic and safe. +
+ +$ jam new my-project
+ Copied!
+ +const std = import("std"); + +// Simplicity at its core +fn main() u8 { + std.fmt.println("Hello, World!"); + + for i in 0:5 { + std.fmt.println("Spreading jam..."); + std.thread.sleep(100); + } + + return 0; +}+
Trusted by engineers at
+Designed for developer happiness and raw performance. It's the perfect blend.
+{{ feature.description }}
+
+ Join thousands of developers building the future with Jam today.
+{{ page.chapter_intro }}
+