https://github.com/seven1m/natalie Skip to content Sign up * Why GitHub? + Features + Mobile + Actions + Codespaces + Packages + Security + Code review + Issues + Integrations + GitHub Sponsors + Customer stories * Team * Enterprise * Explore + Explore GitHub + Learn and contribute + Topics + Collections + Trending + Learning Lab + Open source guides + Connect with others + The ReadME Project + Events + Community forum + GitHub Education + GitHub Stars program * Marketplace * Pricing + Plans + Compare plans + Contact Sales + Education [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} seven1m / natalie Public * Notifications * Fork 38 * Star 420 * a unique Ruby implementation, compiled to C++ (WIP) natalie-lang.org MIT License 420 stars 38 forks Star Notifications * Code * Issues 10 * Pull requests 4 * Actions * Security * Insights More * Code * Issues * Pull requests * Actions * Security * Insights master Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags 7 branches 0 tags Code Latest commit @seven1m seven1m Merge pull request #304 from OhadRau/ range-include-numeric-opt ... 90ead2c Dec 23, 2021 Merge pull request #304 from OhadRau/range-include-numeric-opt 90ead2c Git stats * 2,762 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time .builds Upgrade OpenBSD build for 7.0 Dec 4, 2021 .github/workflows Make purpose of our spec runner clearer Dec 10, 2021 bin Show additional help about all the command line debug flags Dec 12, 2021 examples Use the new _s string suffix for symbols everywhere we can Dec 18, 2021 ext Remove submodules no longer in use Jul 23, 2021 include Mark more stuff const Dec 22, 2021 lib Merge pull request #313 from seven1m/array-object-constructor Dec 22, 2021 spec Merge pull request #312 from seven1m/integer-to-f Dec 22, 2021 src Merge pull request #304 from OhadRau/range-include-numeric-opt Dec 23, 2021 test Add tests for RangeObject::include() numeric optimizations Dec 22, 2021 .clang-format Start using clang-format Apr 3, 2020 .clang-tidy Add clang-tidy config and start working on adding const everywhere Dec 13, 2021 .dockerignore Update Docker config Aug 14, 2020 .editorconfig Fix editorconfig for C++ files May 27, 2020 .git-blame-ignore-revs Ignore last commit in git blames Jul 11, 2020 .gitignore Ignore ccls-cache (Editor LSP cache) Dec 16, 2021 .gitmodules Remove submodules no longer in use Jul 23, 2021 .ruby-version Put back .ruby-version file Dec 13, 2021 CONTRIBUTING.md Replace make with rake in contribution guidelines Sep 25, 2021 Dockerfile Switch hosting Ruby to 3.0 Dec 4, 2021 Gemfile Use our own SexpProcessor Oct 2, 2021 Gemfile.lock Remove sexp_processor dependency from Gemfile.lock Oct 3, 2021 LICENSE Update copyright, include 'and contributors' Jul 15, 2021 Makefile Add a simple Makefile that tells the user to run 'rake' Dec 18, 2021 README.md Simplify the README by doing more stuff with rake Dec 18, 2021 Rakefile Pass CI env var into Docker Dec 19, 2021 View code [ ] Natalie Helping Out Building Usage Using With Docker Running Tests What's the difference between the 'spec/' and 'test/' directories? Copyright & License README.md Natalie github build status builds.sr.ht status MIT License Natalie is a very early-stage work-in-progress Ruby implementation. It provides an ahead-of-time compiler using C++ and gcc/clang as the backend. Also, the language has a REPL that performs incremental compilation. demo screencast There is much work left to do before this is useful. Please let me know if you want to help! Helping Out Contributions are welcome! You can learn more about how I work on Natalie via the hacking session videos on YouTube. The easiest way to get started right now would be to find a method on an object that is not yet implemented and make it yourself! Also take a look at good first issues. (See the 'Building' and 'Running Tests' sections below for some helpful steps.) We have a very quiet Discord server -- come and hang out! Building Natalie is tested on macOS, OpenBSD, and Ubuntu Linux. Windows is not yet supported. Natalie requires a system Ruby (MRI) to host the compiler. Prerequisites: * git * autoconf * automake * libtool * make * gcc or clang * Ruby 2.7.x or Ruby 3.0.x (rbenv preferred) * ccache (optional) Install the above prerequisites on your platform, then run: git clone https://github.com/seven1m/natalie cd natalie rake NOTE: Currently, the default build is the "debug" build, since Nataile is in active development. But you can build in release mode with rake build_release. Usage REPL: bin/natalie Run a Ruby script: bin/natalie examples/hello.rb Compile a file to an executable: bin/natalie examples/hello.rb -c hello ./hello Using With Docker docker build -t natalie . # build image docker run -it --rm natalie # repl docker run -it --rm natalie -e "p 2 * 3" # immediate docker run -it --rm -v$(pwd)/myfile.rb:/myfile.rb natalie /myfile.rb # execute a local rb file docker run -it --rm --entrypoint bash natalie # bash prompt Running Tests To run a test (or spec), you can run it like a normal Ruby script: bin/natalie spec/core/string/strip_spec.rb This will run the tests and tell you if there are any failures. If you want to run all the tests that we expect to pass, you can run: rake test Lastly, if you need to run a handful of tests locally, you can use the test/runner.rb helper script: bin/natalie test/runner.rb test/natalie/if_test.rb test/natalie/loop_test.rb What's the difference between the 'spec/' and 'test/' directories? The files in spec/ come from the excellent ruby/spec project, which is a community-curated repo of test files that any Ruby implementation can use to compare its conformance to what MRI (Matz's Ruby Intepreter) does. We copy specs over as we implement the part of the language that they cover. Everything in test/ is stuff we wrote while working on Natalie. These are tests that helped us bootstrap certain parts of the language and/ or weren't covered as much as we would like by the official Ruby specs. We use this to supplement the specs in spec/. Copyright & License Natalie is copyright 2021, Tim Morgan and contributors. Natalie is licensed under the MIT License; see the LICENSE file in this directory for the full text. Some parts of this program are copied from other sources, and the copyright belongs to the respective owner: file(s) copyright license dtoa.c David M. Gay, Lucent custom Technologies permissive fiber_value.* Evan Jones MIT big_int.* Syed Faheel Ahmad MIT spec/* (see spec/ Engine Yard, Inc. MIT LICENSE) See each file above for full copyright and license text. About a unique Ruby implementation, compiled to C++ (WIP) natalie-lang.org Topics ruby language compiler cpp Resources Readme License MIT License Stars 420 stars Watchers 14 watching Forks 38 forks Contributors 24 * @seven1m * @richardboehme * @TheGrizzlyDev * @davidot * @alimpfard * @timcraft * @borisromanov * @imustafin * @RobertBendun * @jcs * @OhadRau + 13 contributors Languages * Ruby 61.9% * C++ 30.3% * C 7.8% * (c) 2021 GitHub, Inc. * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.