Coder Social home page Coder Social logo

theprimeagen / ts-rust-zig-deez Goto Github PK

View Code? Open in Web Editor NEW
560.0 560.0 164.0 3.22 MB

Zig 1.23% Rust 8.17% TypeScript 2.98% Dockerfile 2.46% Fortran 6.29% Crystal 5.31% C# 6.63% Shell 2.04% PHP 6.10% Python 4.95% CMake 0.74% C 6.23% C++ 10.26% OCaml 5.35% Standard ML 0.17% F# 0.57% Dart 11.75% Monkey 0.06% Java 17.55% Elixir 1.19%

ts-rust-zig-deez's Introduction

Degens Interpreter Competition (DIC)

Based on the awesome book "Writing An Interpreter In Go" by Thorsten Ball
ThePrimeagen receives no financial incentive for this work. Its for you

Work In Progress

Contributing

Code Owners

We most certainly need more code owners. If you wish to give the green check to code of a certain language, please add yourself as owner. If approved, i'll merge. I cannot possibly review all of these. :)

Participation

Implementations in TypeScript, Rust or Zig are reserved and maintained by ThePrimeagen himself.

For other languages, remember: first come, first serve. If there exists an implementation in your language of choice, contribute to it!

If not, start by copying LANG_TEMPLATE folder:

cp -r .github/LANG_TEMPLATE/ <your_folder_name>

It comes with:

├── .gitignore  # ignores all editor-specific or os-specific files, add additional stuff for your language
├── Dockerfile  # for Docker builds
└── Makefile    # convenient commands runner (make <cmd>) under *NIX systems

Now, the convenient commands runner (.\make.cmd <cmd>) under Windows is completely optional and resides in the root of .github/

Running

Command names

General:

  • help — outputs all the commands available, same as running the make or make.cmd without arguments

Without Docker:

  • clean
  • fmt
  • lint
  • test — should run all the available tests
  • ready — should run fmt, lint ant test

Docker:

  • docker-build — makes the build
  • docker-ready — runs the build image and executes fmt, lint, test commands inside

*NIX (Linux, macOS, etc.)

This assumes there is a Makefile in the root of the language directory.

# without docker
make clean
make fmt
make lint
make test
make ready  # runs fmt, lint and test

# docker, assuming there's a Dockerfile
make docker-build  # makes the build
make docker-ready  # runs fmt, lint and test in the built image

Windows

This assumes there is a make.cmd in the root of the language directory.

@rem without docker
.\make.cmd clean
.\make.cmd fmt
.\make.cmd lint
.\make.cmd test
.\make.cmd ready  @rem runs fmt, lint and test

@rem docker, assuming there's a Dockerfile
.\make.cmd docker-build  @rem makes the build
.\make.cmd docker-ready  @rem runs fmt, lint and test in the built image

ts-rust-zig-deez's People

Contributors

alexjercan avatar anis-dr avatar blazkowolf avatar devnote-dev avatar echriser avatar fa-c-shus avatar hermannm avatar jon-lipstate avatar leo-costa avatar lh2 avatar lucastavaresa avatar marcusziade avatar meenzen avatar newmaidumosa avatar novusnota avatar plneple avatar rafrunner avatar ryanwinchester avatar shreyassanthu77 avatar spongman avatar theprimeagen avatar tjdevries avatar tomasdurica avatar trvswgnr avatar unconv avatar vhladko avatar vincer2040 avatar wartab avatar xnacly avatar zivlakmilos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ts-rust-zig-deez's Issues

Dad I miss you

Haven't seen you in awhile dad. I hope you can find some time to hang out with me soon

Mom said your second youtube channel's doing well! She still won't let me watch it. Something about "not being ready for deys nuts"? I'm not even allergic to nuts

Hosted on Linode?

Will the interpreters run on Linode? We could provide a terraform setup to make it IoC and easy.

Inception

When are we doing a monkey interpreter?

Crystal Lexer

Thank you Prime for your review of the lexer, I'm happy you were able to pick up Crystal relatively quickly. I originally based it on the TypeScript version which threw an error, but I will be sending a PR later this evening to update it and catch up with the other lexers.

P.S. there isn't an official tree sitter for Crystal yet but we're working on it. :)

bug???: pr-worthy-yaml....

I think there was a change to the yaml that is causing the Build docker image for every language to fail.

About 5 hours ago my builds were working fine passing job
first line of step: for i in dart-funk; do if [[ $i != .* ]]; then pushd "$i"; make docker-build; popd; fi; done

now with failing job
first line: for i in dart-funk "dart-funk; do if [[ $i != .* ]]; then pushd "$i"; make docker-build; popd; fi; done

Please note the quote before the directory name in the failing job. Not sure if it's the dash in the folder name

which makes the error sound about right: line 1: unexpected EOF while looking for matching `"'

Consider me a dolt and help me understand why I'm wrong here ;-)

Haskell: add in-code comments

Hi @alexjercan (pinging you as you are in the CODEOWNERS for haskell. Correct me if I am wrong)

First. Congratulations! having different Lexer is a good way to show different Haskell techniques. I'd suggest to add coments in all files explaining a little bit what's going on. I know the readme already does this (and It does it very good), but having a more in-code comments could help. For example

LParens <$ advance -- This is criptic for someone not knowing haskell...

Moreover, having different lexer can lead to confusion, so It would be nice to have a big comment at the beginning of the file explaining the technique in used. Also, pointing out that some of them are not the "idiomatic"/"strongest" way of doing the job. For example, the Basic.hs lexer is very simple but using in real-world Parsec.hs or State.hs are the actual idiomatic implementations of the lexer.

So I propose, for each file:

  • Add a hearder comment explaining the technique
  • If the lexer is not Parsec.hs or State.hs add a disclaimer in such a header like "This is not the most convinient way"
  • For every function using creepy symbols like <*>, <$, ... add a line comment explaining what it means (roughly)
  • A few more comments for unusual things, like using "prime" for variable names like (lexer, lexer', lexer'', etc...)

Are you ok if I do it and you (or other person) review it?, do you prefer to do it yourself, or not do it at all?

Thanks

C++ code questions

~~ Hi, whats up with that Iterator>=container.end() stuff, why check for >=, it is not supposed to work like pointers, it just gives you std::end, if you iterated to the ater the end or in case of not finding value by comparator, as i undestand, please correct me if i am wrong. (source)~~
nvm i am blind

loop over generated output rather than the expected output

if you loop over expected output and an extra element is returned from lexer tests still passes. So it should be otherway around?
I think
sol -

 var index: usize = 0;
   while (true) : (index += 1) {
        const tok = lex.next_token();
        var token = Token.illegal;
        if (tokens.len < index) {
            token = tokens[index];
        }
        try expectEqualDeep(token, tok);
        if (tok == .eof) {
            break;
        }
    }

License?

Edit: Since this issue got 1 downvote, let me tear down this a lil bit.

TLDR;

Choosing a license for your project is a crucial step in making it accessible and open to the public. Without a license, no one can use your code, and that defeats the purpose of sharing it on platforms like GitHub. It is important to understand that no license means that all rights are reserved, and you cannot modify or redistribute the code without explicit permission from the copyright holder. This not only limits the potential reach of your project but also makes it difficult for others to collaborate and contribute to it.

Introduction

When it comes to sharing your GitHub project with others, choosing the right license is crucial. It's a decision that can greatly impact how people use and share your code without any legal complications or copyright violations. A well-crafted license provides clear guidelines on modifications, distribution, and usage of your work while protecting you from potential infringement issues. Therefore, selecting a suitable license for your project should be given utmost importance as it reflects both the goals you have set for yourself and the level of control you want over what happens with your creation in future endeavors.

Choosing a Licence

Various licenses exist, ranging from Permissive to Copyleft ones, to proprietary ones. The former type such as MIT and Apache grants users the freedom to utilize, adapt and circulate your code without any limitations. On the other hand, GPL, a Copyleft license mandates that modified versions of original work must also be licensed under identical terms. Moreover, licenses like the Common Development and Distribution License (CDDL) that are proprietary in nature impose restrictions on the user's rights and necessitate their consent to specific terms and conditions. These types of licenses serve as a safeguard for businesses' intellectual property, like TheStartup™, preventing unauthorized usage, modification, or distribution of software by others without prior permission.

It's crucial to take into account how compatible your chosen license is with others that are integrated or relied upon by your codebase. Incompatibility can lead to legal complications while hindering reusability opportunities for your software solution. Fortunately, in case you are not sure which license should go with your project, there are many websites to help you out, most notably the choosealicense website.

Conclusion

To sum up, selecting the appropriate license for your code is undoubtedly important to ensure its accessibility to everyone. Your code becomes useless without a license and cannot be utilized by anyone. Therefore, it's crucial to conduct thorough research on each available option before finalizing one. With careful consideration comes a great reward, your code will become an invaluable resource for the community!

Resources

docs.github.com

Discussion: how should we test the performance?

Here on GitHub, we can do such a simple and free workflow — whenever someone pushes their changes into the master branch:

  1. There would start a GitHub Actions workflow specifically for those languages, which files have changed with that push
  2. It would run a series of performance tests, say, for the lexer of Rust (if there was an update for Rust)
  3. Upon completion, the workflow would upload results as artifacts

And then those results could be downloaded at any given point of time for up to 90 days after the test — that'll mean ThePrimeagen can come up with an arbitrary point in time, download test results all at once and then parse them.

Now, the workflow can be different, but the question is: how do we test the speed of interpreters doing lexing, for example?

  • By simple time command?
  • Using perf stat?
  • Using Apache Bench plus some proxy which would feed tests into them? (to get some GC going on)
  • ???

@ThePrimeagen

Hello?

This project has been dead for a while now, is there ever any chance of it coming back, or do we just make a fork?

What exactly should individual languages be implementing?

I only watch the streams occasionally so I am not up to date on everything happening, but It would be nice to have some spec and requirements for the implementations at least in the readme. I'd love to contribute, but I don't even know what to be contributing.

Using an External Repo for JJDSL

@novusnota , I'd assume this falls more into your ballpark. But right now I have ts-rust-zig-deez master set as the default Repository that JJDSL pulls the files from. However this causes some problems.

  1. If any changes to the commit tree happens that impacts a reference Commit, JJDSL will break.

  2. Cloning a Git Repo brings in all the files. The current "build" phase of JJDSL is to clone the repo, jump around the commits in Master, extract a file, and eventually delete the repository. I was thinking it would be fine, as the overall size of the Repository is current 6mb. But I'm also not sure if the eventual Packages will have the ability to manage two repositories (Likely being paranoid here.

Would I be able to host the "source code" repository for JJDSL on a repository on my own Account? So it would pull from https://github.com/Crain-32/JJDSL-Source.git on master, instead of https://github.com/ThePrimeagen/ts-rust-zig-deez. I'm mostly concerned about any commit changes impacting it.

benchmark?

hi, in one of prime videos i think that this project was made to benchmark languages but i cannot find any video of his or a list of the benchmark result

Suggestion to preserve ThePrimeagen's time and sanity

Ok, so maintaining this repo with all the PRs gets really unwieldy even with people slowly getting on CODEOWNERS file.

Hence, I propose a solution — to split the repo in two:

  1. ThePrimeagen & TJ will continue to work here on Rust, Zig, TS and OCaml
  2. Degen legion and all language implementations will move to a different, community-maintained repo

This way Prime won't have to take care of maintaining anything but his own good stuff :)
Therefore, less management and more excitement towards coding!

@ThePrimeagen if you agree, pls, send here the list of people selected on Monday stream. I'll organize the rest.

Looking for maintainers of specific languages.

My fellow degens,

As Lord of the degens it's rest upon me to lead us into this glorious interpreted challenge, but at the same time I find myself weary of languages I do not understand. I call upon the degen legion to bring forth representatives willing to shepherd various languages

I will bequeath merge powers to whoever wins the hearts and minds of ethe degens

So arise my maidenless tarnishes, nominate yourself for a language.

All languages that are not TypeScript, rust, zig need representatives.

No, I did not proofread this, why do you ask?

Code owners

I have to get this working... unsure when i will, but i will! Merged pr #90 for this, just never used codeowners as a way to manage the suppository, glad to try

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.