{"id":17494788,"url":"https://github.com/curtisfenner/smol-builder","last_synced_at":"2025-09-02T11:05:40.968Z","repository":{"id":75645904,"uuid":"91430278","full_name":"CurtisFenner/smol-builder","owner":"CurtisFenner","description":"(No longer developed: see shiru-ts for successor project) The Smol compiler and reference document.","archived":false,"fork":false,"pushed_at":"2020-07-16T03:21:00.000Z","size":819,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-31T21:58:26.596Z","etag":null,"topics":["compiler","portable","programming-language","smol-compiler","smt"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CurtisFenner.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-16T07:44:10.000Z","updated_at":"2024-04-05T03:46:28.000Z","dependencies_parsed_at":"2023-06-07T05:45:31.221Z","dependency_job_id":null,"html_url":"https://github.com/CurtisFenner/smol-builder","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/CurtisFenner/smol-builder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CurtisFenner%2Fsmol-builder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CurtisFenner%2Fsmol-builder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CurtisFenner%2Fsmol-builder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CurtisFenner%2Fsmol-builder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CurtisFenner","download_url":"https://codeload.github.com/CurtisFenner/smol-builder/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CurtisFenner%2Fsmol-builder/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273272560,"owners_count":25075985,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-02T02:00:09.530Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compiler","portable","programming-language","smol-compiler","smt"],"created_at":"2024-10-19T13:43:04.304Z","updated_at":"2025-09-02T11:05:40.928Z","avatar_url":"https://github.com/CurtisFenner.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# The Smol Programming Language and Documentation\n\n**[A full description of Smol can be found here.](docs/smol.md)**\n\nI have been designing Smol since Spring of 2017.\nMy mission is to create a programming language that rigidly enforces the\nconventions that I have found to be helpful\nin designing maintainable software. These conventions include\n* Statically checked functional correctness\n* Explicitness\n* Immutability\n* Totally defined behavior\n\n# The Smol Compiler, `smolc`\n\n**`smolc`** is a highly-portable compiler for the toy programming language I\ncall Smol that emits standard-conforming ISO C99.\n**Smol** is a pure, statically-typed, procedural programming language that\nincludes classes, interfaces, tagged unions, and generics.\n\nSmol also includes a **verification framework** that allows assertions to be\nchecked *statically* with *zero runtime cost*. This analysis is mostly sound;\nprograms written in Smol do not reach error states.\n\n## Hello world!\n\n```java\n// Every Smol file begins with a \"package\" declaration, which is a namespace.\npackage hello;\n\n// You must explicitly import types defined in other files.\nimport core;\n\n// This class called `HelloWorld` defines a static function called `main`,\n// which is the entry point of this hello world program.\nclass HelloWorld {\n\tstatic main!() Unit {\n\t\t// Invoke a static action on the core:Out type.\n\t\t// The `!` indicates that the function is not pure.\n\t\tdo core:Out.println!(\"Hello world!\");\n\n\t\t// Statically checked assertions can be embedded in your code\n\t\tassert (1 + 2) == 3;\n\t}\n}\n```\n\n## Installing the Smol compiler\n\nThese instructions explain what you need to run `smolc` and the compiler tests.\n\nFirst, install Lua 5.1, Lua 5.2, or Lua 5.3. Lua may already be installed on\nyour machine!\n`$ lua -v` will print the installed version.\n\nNext, clone this repository.\n\n```\n$ git clone https://github.com/CurtisFenner/smol-builder.git\n$ cd smol-builder\n```\n\nThe compiler does not need to be built or prepared in any way and it does not\nhave any dependencies other than Lua 5.1/5.2/5.3.\n\n## Using the Smol compiler\n\nYou can invoke the compiler directly by listing all .smol files that should be\ncompiled and indicating the main class:\n\n```\n$ lua src/compiler.lua --sources tests-positive/runtime/hello-world/test.smol --main test:Test\n```\n\nThis produces a C99 `output.c` file in the current directory that you can\ncompile with your favorite C compiler:\n\n```\n$ gcc -std=c99 -pedantic output.c -o smol-hello-world\n$ ./smol-hello-world\nHello world!\nHello\n\tworld!\nこんにちは世界\n$\n```\n\n## Running the Smol compiler tests\n\nThe tests have a few extra dependencies:\n\n* You need to have `ls` available in your path\n    (Cygwin/MinGW will work on Windows)\n* Your installation of Lua 5.1/5.2/5.3 must support `io.popen`\n    (most installations of Lua support `io.popen` by default)\n* You need a version of `gcc` installed in your path that supports pedantic C99\n\nTo run all the tests, run the following from the smol-builder directory:\n\n```\n$ lua test.lua\n```\n\nTo only run certain tests, include a filter substring as the first argument to\nthe test script:\n\n```\n$ lua test.lua hello\n```\n\n**NOTE**: This produces C code and then compiles and executes that C code.\nCompiler bugs are inevitable, exercise caution!\n\n## VSCode Plugin\n\nThe VSCode extension can be found here:\nhttps://marketplace.visualstudio.com/items?itemName=curtisfenner.smolcomp.\n\nThis extension provides syntax highlighting and red-underlining of errors.\nConfigure it by pointing it to the `src/compiler.lua` file in the cloned folder.\n\n## Author\n\n[Curtis Fenner](http://curtisfenner.com),\nundergraduate at University of Michigan, 2014 - 2018.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcurtisfenner%2Fsmol-builder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcurtisfenner%2Fsmol-builder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcurtisfenner%2Fsmol-builder/lists"}