{"id":41612675,"url":"https://github.com/blitmaps/mylo-lang","last_synced_at":"2026-02-22T10:15:21.138Z","repository":{"id":333832248,"uuid":"1138614885","full_name":"blitmaps/mylo-lang","owner":"blitmaps","description":"A cool programming language, implemented in C, that uses a VM and has cool syntax; with inline C capability.","archived":false,"fork":false,"pushed_at":"2026-01-27T17:00:59.000Z","size":312,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-28T00:42:46.209Z","etag":null,"topics":["c","compiler","cool-language","intermediate-code-generation","programming-language","strongly-typed","suckless-software","toy-language","virtual-machine"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/blitmaps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-20T22:37:59.000Z","updated_at":"2026-01-27T17:06:44.000Z","dependencies_parsed_at":"2026-01-27T15:00:25.362Z","dependency_job_id":null,"html_url":"https://github.com/blitmaps/mylo-lang","commit_stats":null,"previous_names":["blitmaps/mylo-lang"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/blitmaps/mylo-lang","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blitmaps%2Fmylo-lang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blitmaps%2Fmylo-lang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blitmaps%2Fmylo-lang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blitmaps%2Fmylo-lang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blitmaps","download_url":"https://codeload.github.com/blitmaps/mylo-lang/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blitmaps%2Fmylo-lang/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28889863,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-29T21:06:44.224Z","status":"ssl_error","status_checked_at":"2026-01-29T21:06:42.160Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["c","compiler","cool-language","intermediate-code-generation","programming-language","strongly-typed","suckless-software","toy-language","virtual-machine"],"created_at":"2026-01-24T12:20:01.112Z","updated_at":"2026-02-22T10:15:21.125Z","avatar_url":"https://github.com/blitmaps.png","language":"C","readme":"![A Derpy Logo](docs/mylogo.png)\n# Mylo\n\nMylo is an experimental language implemented in C, that uses a simple VM and has cool syntax. It has almost seamless C-interoperability.\nLike a sausage dog, it is not serious, but it is cool.\n\n#### 🦗 Mylo is alpha, so expect bugs.\n\nCheck out the [Language Reference](docs/mylo_reference.md).\n\n## Hello Mylo\nHere is `hello.mylo`:\n```javascript\nprint(\"Hello Mylo\")\n```\nWe can run it like this:\n```shell\n\u003e ./mylo hello.mylo\n\nHello Mylo\n```\n\n## Something a bit more complex\nHere is fib.mylo:\n```javascript\nfn fib(n) {\n  if (n \u003c 2) {\n    ret n\n  }\n  // Recursively call fib\n  ret fib(n - 1) + fib(n - 2)\n}\nprint(\"Calculating Fib(10)...\")\nvar result = fib(10)\n// With string interpolation\nprint(f\"result : {result}\")\n```\nHere's the ouput\n```shell\n\u003e mylo fib.mylo\nCalculating Fib(10)...\nresult : 55\n```\n\n## Running a Mylo program\n\n#### With the interpreter\n```bash\n\u003e ./mylo my_program.mylo\n```\n#### Something more complicated\n```bash\nMylo Language v0.2.0\nA lightweight, embeddable language.                                                                                                                                                                                                                                                                                       \n                                                                                                                                                                                                                                                                                                                          \nUSAGE:                                                                                                                                                                                                                                                                                                                    \nmylo [flags] [file]                                                                                                                                                                                                                                                                                                       \n\nFLAGS:\n  --repl          Start the interactive Read-Eval-Print Loop.                                                                                                                                                                                                                                                             \n  --version       Display the current version information.\n  --help          Show this help message.\n  --dap           Enable DAP debugging.\n  --db            Debug mode, load the code and jump into an interactive debugger.\n  --trace         Run as normal but print every VM state change\n  --build         Build and generate a .c bootstrapping source file.\n  --bind          Generate a .c source file binding for later interpreted or compiled dynamic linking\n  --bundle        Compile Mylo application and output mylo_exe (bundle bytecode and VM interpreter).\n  --dump          Dump the generated bytecode instructions.\n\nEXAMPLES:\n  Run a script:                                                                                                                                                                                                                                                                                                           \n    ./mylo script.mylo                                                                                                                                                                                                                                                                                                    \n\n  Start REPL with debug mode:\n    ./mylo --repl                                                                                                                                                                                                                                                                                                         \n\n  Build a native application (with or without inline C Code):\n    ./mylo --build my_file.mylo                               \u003c-- Produced out.c                                                                                                                                                                                                                                          \n     cc out.c src/vm.c src/mylolib.c -o mylo_app -Isrc -lm    \u003c-- Uses GNU / C Compiler to build native Executable                                                                                                                                                                                                        \n    ./mylo_app                                                \u003c-- Runs like any other executable, with bundled VM.                                                                                                                                                                                                        \n                                                                                                                                                                                                                                                                                                                          \n  Dynamically or Statically Use C Code:                                                                                                                                                                                                                                                                                   \n    ./mylo --bind test_lib.mylo                                  \u003c-- Contains C blocks, this outputs test_lib.mylo_bind.c                                                                                                                                                                                                 \n    cc -shared -fPIC test_lib.mylo_bind.c -Isrc -o test_lib.so   \u003c-- Produced a shared object which can be dynamically imported                                                                                                                                                                                           \n  Then inside your mylo applications:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         \n    import native test_lib.mylo        \u003c-- Mylo will look for test_lib.so and load compiled C functions                                                                                                                                                                                                                   \n    print(my_cool_c_func())            \u003c-- C functions from shared objects can be run in the interpreter, or compiled.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   \n```\n\n## Building Mylo\n\n### The simple way\n```bash\n # Call the c compiler with source, and link math.\n\u003e cc src/*.c -o mylo -lm\n```\n### Using CMake (also builds tests)\n```bash\n\u003e cmake -B build\n\u003e cd build\n\u003e make\n\u003e ./tests\n```\n\n## Debugging in VSCode\nMylo supports the DAP protocol. This can be used with any tool that supports DAP, using the `--dap` flag. There\nis a VSCode plugin, in `editors/mylo-vscode` that configures Mylo automatically.\n\n![VSCode Screenshot](docs/vscode.png)\n\n## Debugging in CLI\n\nMylo supports debugging in the command line using the `--db` flag. The Mylo program will launch and stop at the first line.\n\n```javascript\n  SOURCE CODE                                                                                                                                                                                                                                                                                                             \n➤    1 │ system_thread(\"sleep 2 \u0026\u0026 echo Done\", \"my_job\")                                                                                                                                                                                                                                                                  \n     2 │                                                                                                                                                                                                                                                                                                                  \n     3 │ forever {                                                                                                                                                                                                                                                                                                        \n     4 │     var res = get_job(\"my_job\")                                                                                                                                                                                                                                                                                  \n     5 │     if (res == 1) {                                                                                                                                                                                                                                                                                              \n     6 │         print(\"Working...\")                                                                                                                                                                                                                                                                                      \n     7 │     } else {                                                                                                                                                                                                                                                                                                     \n     8 │         print(f\"Result: {res[0]}\")                                                                                                                                                                                                                                                                               \n     9 │         break                                                                                                                                                                                                                                                                                                    \n    10 │     }                                                                                                                                                                                                                                                                                                            \n    11 │ }                                                                                                                                                                                                                                                                                                                \n  VM STATE                                                                                                                                                                                                                                                                                                                \n  FP: 0     SP: -1                                                                                                                                                                                                                                                                                                        \n  -- Globals --                                                                                                                                                                                                                                                                                                           \n    res         : 0                                                                                                                                                                                                                                                                                                       \n  -- Locals --                                                                                                                                                                                                                                                                                                            \n    (None)                                                                                                                                                                                                                                                                                                                \n  mylo-db \u003e\n    // Commands:\n    // n          Next line\n    // s          Step instruction\n    // c          Continue\n    // b \u003cline\u003e   Set breakpoint\n    // p \u003cvar\u003e    Print variable\n    // set \u003cx\u003e v  Set variable x to v\n    // q          Quit\n```\n\n## But everything cool is written in C, how do I use those libraries?\n### Building a native binary with inline C?\nHere is some Mylo code jumping into C and back...\n```javascript\n// 1. Explicit return: num\nvar result: num = C(val: i32 = 25) -\u003e num {\n    double res = sqrt(val);\n    printf(\"Inside C: sqrt(%d) = %f\\n\", (int)val, res);\n    return res;\n}\n\nprint(f\"Back in Mylo: Result is {result}\")\n```\n\nFor more information, read the FFI section of the reference.\n\nWe build it by producing a C source file with embedded VM code and wrapper code pre-generated.\n\n```shell\n# This produces an out.c file\n\u003e mylo --build example.mylo\n```\n\nWe then just compile it, like any other C file, but we need to include\nthe Mylo VM source and headers.\n```shell\n# This produces mylo_app\n\u003e  gcc out.c src/vm.c src/mylolib.c -o mylo_app -Isrc -lm  \n```\n\nOur application can then be executed (without a runtime):\n```shell\n# Run\n\u003e ./mylo_app\n  Inside C: sqrt(25) = 5.000000\n  Back in Mylo: Result is 5\n```\n\n## Integration with CMake\nMylo applications can be built, C applications bound, and integrated into other applications\nwith CMake. There are [docs here.](cmake/README.md)\n\n\n## Mylo REPL\n\nMylo can be launched in interpreter mode to evaluate commands from the CLI. It can also be used\nto load native dlls and to import other mylo modules.\n\nLaunch the Mylo repl with `mylo --repl`. An example can be seen below running in Powershell:\n\n```powershell\nPS C:\\Users\\Brad\\Documents\\mylo-lang\\build\u003e .\\mylo.exe --repl\nMylo REPL v0.1.5\nType 'exit' to quit.\n\u003e var x = range(20, 2, -2)\n\u003e print(x)\n[20, 18, 16, 14, 12, 10, 8, 6, 4, 2, 0, -2]\n\u003e \n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblitmaps%2Fmylo-lang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblitmaps%2Fmylo-lang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblitmaps%2Fmylo-lang/lists"}