{"id":20483336,"url":"https://github.com/styczynski/instant-mrjp","last_synced_at":"2026-06-29T23:31:04.134Z","repository":{"id":220041579,"uuid":"711514999","full_name":"styczynski/instant-mrjp","owner":"styczynski","description":"Latte compiler (MRJP) 2023/2024","archived":false,"fork":false,"pushed_at":"2025-04-30T21:32:03.000Z","size":97329,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-30T17:50:11.620Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Haskell","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/styczynski.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2023-10-29T14:03:34.000Z","updated_at":"2024-04-19T21:09:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"3bf5a43e-4665-415b-8278-a52adc140433","html_url":"https://github.com/styczynski/instant-mrjp","commit_stats":null,"previous_names":["styczynski/instant-mrjp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/styczynski/instant-mrjp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/styczynski%2Finstant-mrjp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/styczynski%2Finstant-mrjp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/styczynski%2Finstant-mrjp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/styczynski%2Finstant-mrjp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/styczynski","download_url":"https://codeload.github.com/styczynski/instant-mrjp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/styczynski%2Finstant-mrjp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34947088,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-29T02:00:05.398Z","response_time":58,"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":[],"created_at":"2024-11-15T16:17:03.668Z","updated_at":"2026-06-29T23:31:04.080Z","avatar_url":"https://github.com/styczynski.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# latte-mrjp\nps386038\nLatte compiler (MRJP) 2023/2024\n\n**Stan na 23.01.2024**\n\n## Budowanie u uruchamianie\n\nProgram buduje się standardowo przy pomocy polecenia `make` w katalogu głównym projektu:\n```bash\n    $ make\n```\n\nŹródła biblioteki standardowej Latte znajdują się w `src/Runtime/runtime.h` i `src/Runtime/runtime.c`\n\n**Uwaga:**\nProjekt wymaga sporej ilości zalezności:\n- containers, text, bytestring (Rózne popularne biblioteki)\n- array, keys (Rozszerzenia istneijących kontenerów)\n- co-log, diagnose (Logowanie i formatowanie błędów)\n- mtl, transformers, monad-extras (Dodatki do funktorów i monad)\n- lens, tuple-append, generic-lens (Lens i podobne)\n- stacked-dag (Ładne formatowanie DAGów do ascii-artów)\n- fgl (Konstrukcja grafów)\n- fuzzyset (Zbiory wspierające fuzzymatching)\n- prettyprinter, prettyprinter-ansi-terminal (Wypisywanie kolorowanych dokumentów)\n- time (Obsługa czasu)\n- ordered-containers (Implementacja kontenerów pamiętających kolejność)\n- deepseq (Wsparcie dla głębokiej ewaluacji struktur; Notatka: w tym momencie większość struktur deklaruje instancje MkData ale nie jest uywana poza scenariuszami debugowania kompilatora)\n- directory, process (Standardowe biblioteki System.*)\nPowysze zaleności mogą wymagać sporo miejsca a budowanie zajmuje moment za pierwszym razem (niestety są to ograniczenia serwera students)\n\n## Rozwiązanie\n\nZaimplementowane backendy:\n- `Assembler X86_64`\n\nZaimplementowane funkcjonalności na dzień 23.01.2024:\n\n- Klasy z dziedziczeniem\n- Metody wirtualne\n- Tablice\n- Garbage collection\n- Alokacja rejestrów przy pomocy kolorowania grafów\n- Lepsze optymializacje peephole\n- Globalne i lokalne usuwanie stałych, lepsze usuwanie martwego kodu i lepsza optymalizacja skoków\n- Dopuszczane jest uźycie `var` w przypadku deklaracji z wartością np. `var x = foo(2)+\"b\"`, wtedy typ jest automatycznie inferowany (w innych kontekstach typ `var` nie jest dopusczany)\n- Kaźdy obiekt jak w Javie dziedziczy po klasie `Object`\n- Typy prymitywne `int`, `bool` i `byte`\n- Operacja `+` jest przeciązona tj. jest zdefiniowana jako:\n    ```\n        (+) :: String -\u003e (int | bool | byte | Object) -\u003e String\n        (+) :: str o = str ++ (o.toString)\n        (+) :: int -\u003e int -\u003e int\n        (+) inta intb = inta + intb\n        (+) :: byte -\u003e byte -\u003e byte\n        (+) bytea byteb = bytea + byteb\n    ```\n- Błędy typowania podają kontekst błędu oraz potencjalne sposoby naprawienia go\n- Biblioteka standardowa implementująca metody znane z Javy (patrz uwaga 5 w brakach ponizej)\n- 112 rónych testów w tym własnych, dostępnych w test/Test/*Spec.hs\n- Obsługa generycznej funkcji `print(Object)`. Fajnie działa dla np. `print(int[])`\n\n**Braki w implementacji oraz plany:**\n- Poprawione zostały niedociągnięcia z ostatniej wersji rozwiązania, jednakze zliczanie referencji zostało wyłączone poniewaź generowało problemy z dostępem do pamięci\n\n```java\nclass Object {\n    boolean equals(Object other);\n    int getHashCode();\n    string toString();\n}\n\nclass String extends Object {\n    int charAt(int pos);\n    boolean equals(Object other);\n    string concat(string other);\n    boolean startsWith(string substr);\n    boolean endsWith(string substr);\n    byte[] getBytes();\n    int indexOf(string substr, int startIndex);\n    int length();\n    string substring(int index, int length);\n    string toString();\n    int getHashCode();\n}\n\nclass Array extends Object {\n    int length;\n    string toString();\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstyczynski%2Finstant-mrjp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstyczynski%2Finstant-mrjp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstyczynski%2Finstant-mrjp/lists"}