{"id":13609716,"url":"https://fbgencer.github.io/fbgc/","last_synced_at":"2025-04-12T20:32:18.860Z","repository":{"id":56263234,"uuid":"160015804","full_name":"fbgencer/fbgc","owner":"fbgencer","description":"Small Programming Language in C","archived":false,"fork":false,"pushed_at":"2020-12-12T23:58:39.000Z","size":72666,"stargazers_count":8,"open_issues_count":1,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-04T17:51:49.211Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fbgencer.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}},"created_at":"2018-12-02T05:13:35.000Z","updated_at":"2025-01-27T10:26:18.000Z","dependencies_parsed_at":"2022-08-15T15:40:27.621Z","dependency_job_id":null,"html_url":"https://github.com/fbgencer/fbgc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fbgencer%2Ffbgc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fbgencer%2Ffbgc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fbgencer%2Ffbgc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fbgencer%2Ffbgc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fbgencer","download_url":"https://codeload.github.com/fbgencer/fbgc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248629949,"owners_count":21136351,"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":[],"created_at":"2024-08-01T19:01:37.354Z","updated_at":"2025-04-12T20:32:16.524Z","avatar_url":"https://github.com/fbgencer.png","language":"C","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"![](https://github.com/fbgencer/fbgc/blob/master/docs/fbgc_small_logo.png)\n\n- Written in C for small memory environments as a calculator and interpreted programming language. However, ![fbgc] is getting powerful to become a programming language or a scientific calculation tool on computers.\n\n##### History\n- It started as a calculator using [Shunting Yard algorithm](https://en.wikipedia.org/wiki/Shunting-yard_algorithm) for ![fbgc] parser. Later it growed and it shows a capacity to become a programming language. Since then it has been improved and also it's under development.\n- Inspired by Python, Matlab, and of course C. Yet it tries to differ somehow from these languages while keeping their good but changing features that is thought as useful.\n\n#### Features\n- Flexible and Dynamically typed\n- Matrices are internal C arrays for fast and reliable computation.\n- Easy to write and learn\n- Easy to extend with a C/C++ libraries\n\nWrite your first program:\n\n```ruby\nprint('Hello World')\n```\n\n## Build\n\n To build ![fbgc], simply run:\n\n    $ make\n\n## Run\n\n![fbgc] allows you to define multiple types of entries. Such as integers, doubles, strings, tuples and matrices. You don't need to specify types as in the case of statically typed languages.\n\nBasic types:\n```ruby\n# This is a line comment\nx = 5 # integer\nx = 3.14159 # double\nx = 'Hey this is a string' # string\nx = (1,2,1.23,('Hey i am tuple!')) # tuple\nx = [1,2,3 ; 4,5,6] # 2x3 matrix\n```\n\nAbsolute operator:\nnumber objects return positive of that number under abs operator\ncomplex object returns 2-d distance\nstring, tuple and matrix objects return their length\n```ruby\n|'fbgc'| # gives 4\n\n|('a','fbgc',1,2,3)| # gives 5\n\n|3+4j| # gives 5.0\n\n|-3| # gives 3\n\n```\n\nFunction definition:\n```ruby\nsum = fun(a,b)\n\treturn a+b\nend\n```\n\n\nConditional structures:\n```ruby\nif(a == 5 \u0026 y == 7)\n\tprint('This is an if structure')\nend\n\nif(x == 5)\n\tprint('Inside if : ',x)\nelif(x == 6)\n\tprint('Inside elif  :',x)\nelse\n\tprint('Inside else: ',x)\nend\n\ni = 0\nwhile(i\u003c5)\n\tprint(i)\nend\n\nParanthesis can be dropped as well. \n\nif i == 5\n\tprint('i is five')\nend\n\nif x == 5 ; print(\"x is 5\"); else print('x is not 5') ; end\n```\n\nIn ![fbgc], for loop allows you to write fast code !\nYou can create a for loop just giving sequence or range \n```ruby\nfor(i = 0:10)\n\tprint(i) #prints 0,1,2,3,4,5,6,7,8,9\nend\n\nfor i = 1:0.1:3.14\n\tprint(i) #prints 1, 1.1, 1.2, 1.3, 1.4 .... 3.1\nend\n\nfor(i = 0:2:10)\n\tprint(i) #prints 0,2,4,6,8\nend\n\nfor (i = 'fbgc')\n\tprint(i) #prints 'f','b','g','c'\nend\n\n#|obj| operator gives you the length of the object\nx = 'Hello world'\nfor (i = 0 : |x|)\n\tprint(x[i])\nend\n```\n\n\n\n## Future Work\n\n  - ◦ Documentation\n  - ✔ Lexer, parser and interpreter\n  - ◦ Meaningful lexical, grammar and program errors\n  - ✔ Internal memory handling mechanism\n  - ✔ Integer computation\n  - ◦ Internal libraries for all object types\n  - ✔ C internal API\n  - ◦ Garbage collection\n  - ◦ Optimizations\n\n![fbgc] is looking forward to be improved. If you are interested in please make pull request. It is under development.\n\n\n[fbgc]: http://chart.apis.google.com/chart?cht=tx\u0026chl=f_{b}^{g}c\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/fbgencer.github.io%2Ffbgc%2F","html_url":"https://awesome.ecosyste.ms/projects/fbgencer.github.io%2Ffbgc%2F","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/fbgencer.github.io%2Ffbgc%2F/lists"}