{"id":26152825,"url":"https://github.com/rsashka/newlang","last_synced_at":"2025-07-12T12:34:25.036Z","repository":{"id":37726285,"uuid":"57589100","full_name":"rsashka/newlang","owner":"rsashka","description":"A programming language with a simple no-keyword syntax for computing tensors and rational numbers with unlimited precision (NOTE: NewLang is experimental; see README)","archived":false,"fork":false,"pushed_at":"2025-04-09T08:15:12.000Z","size":14362,"stargazers_count":21,"open_issues_count":16,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-14T06:06:20.601Z","etag":null,"topics":["c","compiler","cpp","cross-platform","dynamic-typing","interpreter","language","oop","programming-language","pure-function","static-typed","tensors"],"latest_commit_sha":null,"homepage":"http://newlang.net/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rsashka.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"roadmap.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-05-01T07:31:58.000Z","updated_at":"2024-12-29T19:37:15.000Z","dependencies_parsed_at":"2023-01-29T23:45:34.365Z","dependency_job_id":"ff40f7bb-c76e-4587-b915-b7b1123503ca","html_url":"https://github.com/rsashka/newlang","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/rsashka/newlang","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsashka%2Fnewlang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsashka%2Fnewlang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsashka%2Fnewlang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsashka%2Fnewlang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rsashka","download_url":"https://codeload.github.com/rsashka/newlang/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsashka%2Fnewlang/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264991028,"owners_count":23694550,"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","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","cpp","cross-platform","dynamic-typing","interpreter","language","oop","programming-language","pure-function","static-typed","tensors"],"created_at":"2025-03-11T07:22:04.143Z","updated_at":"2025-07-12T12:34:25.015Z","avatar_url":"https://github.com/rsashka.png","language":"C++","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"# About *NewLang* project\n\n*NewLang* is a universal high-level programming language. The main feature of the language is a simple, logical and consistent syntax, based on a strict system of grammar rules. With the help of macros the language syntax can be easily extended to a more familiar form based on keywords. Tensor calculations and rational numbers of unlimited precision are supported at the level of language syntax and basic data types without the use of additional libraries.\n\nCurrent version 0.4 of 23.03.2024 ([New in current version and release history](https://github.com/rsashka/newlang/releases/tag/v0.4.0))\n\n## Main properties and features of the language:\n\n- The ability to work both in interpreter and compiler mode **\\***.\n- Dynamic and static typing with the ability to specify types explicitly.\n- Static typing is conditionally strong (there is no automatic type casting, but conversion between some data types is allowed. *For example, an integer can be automatically converted to real or rational, but not vice versa.*\n- Automatic memory management without garbage collector **\\***\n- Object-oriented programming in the form of explicit class inheritance and \"duck typing\" **\\***\n- Several types of functions (regular and pure functions without side effects) are supported at the syntax level of the language\n- Optional and named function arguments\n- Direct insertion of C/C++ code is possible **\\***\n- Easy integration with existing software libraries (including import of native variables, functions and classes* from C/C++).\n- There is a \u003ca href=\"https://en.wikipedia.org/wiki/REPL\"\u003eREPL (read-eval-print loop)\u003c/a\u003e\n- Symbolic calculations **\\*\\***\n\n---\n**\\***) These features are planned for implementation when the compiler is created.\n\n**\\*\\***) Symbolic calculations are supported at the syntax level, but not implemented.\n\n---\n\n[Language syntax](http://newlang.net/docs/syntax/)\n\n[Detailed description of the type system](http://newlang.net/docs/types/)\n\n[Operators and control structures](http://newlang.net/docs/ops/)\n\n[Playground and example code](http://newlang.net/playground/?id=1)\n\n### Example of \"Hello world!\" script in NewLang language\n\n```python\n    #!../output/nlc \n\n    print('Hello, world!\\n');\n```\n\nOutput:\n\n```python\n    Hello, world!\n\n    14\n```\n\n\n## Why do we need NewLang?\n\nAll modern programming languages have a constant development (complication) of syntax as new versions are released.\nThis is a kind of payment for the emergence of new features and is perceived by users as a natural process.\n\nBut at the same time it is also a serious problem, since with the release of versions new keywords and syntactic constructions are added, which inevitably raises the entry threshold for new users.\n\nAnother consequence of this process is the constant increase in the complexity of developing and supporting already created software products, when the old code is being finalized using the already new standards.\n\nNewLang naturally limits the complexity of language constructs by splitting the syntax of the language into two parts, making it easier to learn and use.\n\nBasic syntax - for writing programs in object-oriented (imperative) and declarative styles, which is based not on reserved keywords, but on a system of strict grammar rules. It is possible to extend the basic syntax through the use of macros.\nExtended syntax - program inserts in the implementation language (C/C++), when the main syntax becomes insufficient.\n\nAnother disadvantage of modern languages is that most of them were created before the era of machine learning, therefore, tensor calculations are performed in the form of separate libraries.\nThe same applies to calculations with unlimited precision, which also require the use of additional library functions.\n\nNewLang has tensor calculus and unlimited-precision rationals out of the box.\nThey are supported at the syntax level for writing literals of the corresponding types, and simple arithmetic data types are scalars (tensors of dimension zero).\nThe implementation of tensor calculations is based on the library libtorch, and rational numbers using OpenSSL.\n\n\n### Example of calculating factorial 40 using DSL syntax\n\n```python\n    #!../output/nlc \n\n    fact := 1\\1;                # Rational number 1 (no precision limit)\n    mult := @iter( 40..1..-1 ); # Iterator from range for factors from 40 to 2\n    @while( @curr(mult)) {      # Loop until the iterator data runs out\n        fact *= @next(mult);    # Get the current multiplier and move to the next iterator element\n    };\n\n    @assert(fact == 815915283247897734345611269596115894272000000000\\1);\n\n    fact    # Return final result    \n```\n\nOutput:\n\n```bash\n    815915283247897734345611269596115894272000000000\\1\n```\n\n## Feedback\n\nIf you have any suggestions for developing or improving NewLang, [writing](https://github.com/rsashka/newlang/discussions).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frsashka%2Fnewlang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frsashka%2Fnewlang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frsashka%2Fnewlang/lists"}