{"id":13609756,"url":"https://github.com/Feral-Lang/Feral","last_synced_at":"2025-04-12T20:32:20.714Z","repository":{"id":41373349,"uuid":"231769719","full_name":"Feral-Lang/Feral","owner":"Feral-Lang","description":"Feral programming language reference implementation","archived":false,"fork":false,"pushed_at":"2025-04-07T05:19:07.000Z","size":1333,"stargazers_count":142,"open_issues_count":3,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-07T06:25:57.362Z","etag":null,"topics":["bytecode-interpreter","compiler","cpp","cpp20","cxx","cxx20","interpreted-programming-language","interpreter","proglangs-discord","programming-language","scripting-language"],"latest_commit_sha":null,"homepage":"https://feral-lang.github.io/Book","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/Feral-Lang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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}},"created_at":"2020-01-04T13:38:05.000Z","updated_at":"2025-04-05T19:30:57.000Z","dependencies_parsed_at":"2023-01-31T12:00:50.087Z","dependency_job_id":"414e9f9b-1986-4c13-94ea-2c41987c3399","html_url":"https://github.com/Feral-Lang/Feral","commit_stats":{"total_commits":304,"total_committers":5,"mean_commits":60.8,"dds":"0.023026315789473673","last_synced_commit":"4d2aed053d17b8da85dfb9287c7bb5f448b07730"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Feral-Lang%2FFeral","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Feral-Lang%2FFeral/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Feral-Lang%2FFeral/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Feral-Lang%2FFeral/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Feral-Lang","download_url":"https://codeload.github.com/Feral-Lang/Feral/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248629971,"owners_count":21136354,"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":["bytecode-interpreter","compiler","cpp","cpp20","cxx","cxx20","interpreted-programming-language","interpreter","proglangs-discord","programming-language","scripting-language"],"created_at":"2024-08-01T19:01:37.747Z","updated_at":"2025-04-12T20:32:19.290Z","avatar_url":"https://github.com/Feral-Lang.png","language":"C++","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"# About\n\n[![Build Status](https://api.cirrus-ci.com/github/Feral-Lang/Feral.svg?branch=master)](https://cirrus-ci.com/github/Feral-Lang/Feral)\n\nFeral is a dynamically typed, imperative, interpreted language which revolves (to most extent) around the idea of minimalism.\n\nThe primary example being that the language syntax itself does not contain anything related to imports, structure, or enums.\nInstead, there are libraries/functions that allow the user to import modules, and create structures as well as enums.\n\nFor feral, all imports, structures, enums, and functions are variables. This makes all of them a first class citizen.\nOne can pass and modify all of those around in functions, etc, just like a normal variable.\n\nDo note that Feral is not an object oriented programming language, but does support structs and \"associated\" (member) functions for them.\n```py\nlet Struct = struct(member = 5);\nlet instance = Struct(); # default instantiation\ninstance.member = 10;\n```\nThis makes the code a bit cleaner and more pleasant to use. See examples to understand its usage.\n\nThere is also a (WIP) book/guide for Feral available here: [https://feral-lang.github.io/Book/](https://feral-lang.github.io/Book/) ([source](https://github.com/Feral-Lang/Book)).\n\n# Examples\n\n## Hello World\n\n```py\nlet io = import('std/io');\nio.println('Hello World');\n```\n\n## Hello greeting using a function\n\n```py\nlet io = import('std/io');\n\nlet helloFn = fn(name) {\n\tio.println('Hello ', name);\n};\n\nhelloFn('Electrux'); # prints 'Hello Electrux`\n```\n\n## Simple factorial of 5 using a function\n```py\nlet io = import('std/io');\n\nlet facto = fn(num) {\n\tlet fact = 1;\n\tfor i in range(num, 1, -1) {\n\t\tfact *= i;\n\t}\n\treturn fact;\n};\n\nio.println('factorial of 5 is: ', facto(5));\n```\n\n## Creating an empty struct\n```py\nlet structTy = struct(); # empty structure type (struct with no fields)\n```\n\n## Creating a struct with fields\n```py\n# fields `a` and `b` of type integers having default values `10`, and `20` respectively\nlet structTy = struct(a = 10, b = 20);\n```\nTo create objects of this structure:\n```py\n# default values for struct fields\nlet structObj1 = structTy(); # a = 10, b = 20\n\n# overwrite first field's value (a)\nlet structObj2 = structTy(30); # a = 30, b = 20\n\n# overwrite using assigned argument\nlet structObj3 = structTy(b = 30); # a = 10, b = 30\n```\n\n# Installation\n\n## Prerequisites\n\nTo install `Feral`, the following packages are required:\n* CMake (build system - for compiling the project)\n\n## Automated Build (Unix-like OS)\n\nYou can automatically build Feral and its standard library by downloading and running `build.sh`.\nIt requires [Git](https://git-scm.com/) and the packages listed under [Prerequisites](#prerequisites).\n\n```sh\n# Download the script (example using wget:)\nwget https://raw.githubusercontent.com/Feral-Lang/Feral/master/build.sh\n# Run it!\nsh build.sh\n```\n\n## Manual Build\n\nOnce the prerequisites have been met, clone this repository:\n```\ngit clone https://github.com/Feral-Lang/Feral.git\n```\n\nInside the repository, create a directory (say `build`), `cd` in it and run the commands for building and installing Feral:\n```sh\ncd Feral \u0026\u0026 mkdir build \u0026\u0026 cd build\ncmake .. -DCMAKE_BUILD_TYPE=Release # optionally PREFIX_DIR=\u003cdir\u003e can be set before this\ncmake --build . --config Release --parallel=8 --target install\n```\n\nOn Windows, the first cmake command must have this argument as well: ` -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=true`. Therefore, the command will be:\n```sh\ncmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=true # optionally PREFIX_DIR=\u003cdir\u003e can be set before this\n```\n\nBy default, `PREFIX_DIR=$HOME/.feral`.\nOnce installation is done, execute the installed `feral` binary (`$PREFIX_DIR/bin/feral`) to use the Feral compiler/interpreter.\n\n## Post Installation\n\nAfter the installation is done, you'd probably also like to setup the package manager to install packages for the language.\nTo do that, just use `feral pkgbootstrap`.\n\n# Syntax Highlighting Extensions\n\nAs of now, there are Feral language's syntax highlighting extensions available for `Visual Studio Code` and `Vim` editors.\nInstallation steps can be found on their repositories.\n\nVisual Studio Code: [Feral-Lang/Feral-VSCode](https://github.com/Feral-Lang/Feral-VSCode)\n\nVim: [Feral-Lang/Feral-Vim](https://github.com/Feral-Lang/Feral-Vim)\n\n# For Developers\n\nThe `.clang-format` style file is present in the repository: [https://github.com/Electrux/cpp-format](https://github.com/Electrux/cpp-format)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFeral-Lang%2FFeral","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FFeral-Lang%2FFeral","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFeral-Lang%2FFeral/lists"}