{"id":18218861,"url":"https://github.com/arthurbernierjr/mambascript","last_synced_at":"2026-01-03T01:15:58.666Z","repository":{"id":98332809,"uuid":"289794767","full_name":"arthurbernierjr/mambascript","owner":"arthurbernierjr","description":"The rebirth of Typed Unfancy Javascript.... The rebellious teenage love child of TypeScript and Python who is their own person and seeks validation from neither... ( But deep down loves them both and would love their approval)","archived":false,"fork":false,"pushed_at":"2021-10-23T04:42:40.000Z","size":15597,"stargazers_count":4,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-22T12:38:57.634Z","etag":null,"topics":["coffeescript","python3","typescript"],"latest_commit_sha":null,"homepage":"","language":"PEG.js","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/arthurbernierjr.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}},"created_at":"2020-08-24T01:02:09.000Z","updated_at":"2021-11-18T20:41:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"2ae497dd-6a41-42e9-964a-2f586cbe0715","html_url":"https://github.com/arthurbernierjr/mambascript","commit_stats":{"total_commits":1059,"total_committers":34,"mean_commits":"31.147058823529413","dds":0.6222851746931066,"last_synced_commit":"f646d17ae28ce452611448cbb33918e3ea67736c"},"previous_names":["arthurbernierjr/kofuscript"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthurbernierjr%2Fmambascript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthurbernierjr%2Fmambascript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthurbernierjr%2Fmambascript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthurbernierjr%2Fmambascript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arthurbernierjr","download_url":"https://codeload.github.com/arthurbernierjr/mambascript/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246768582,"owners_count":20830696,"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":["coffeescript","python3","typescript"],"created_at":"2024-11-03T18:04:48.846Z","updated_at":"2026-01-03T01:15:58.640Z","avatar_url":"https://github.com/arthurbernierjr.png","language":"PEG.js","funding_links":[],"categories":[],"sub_categories":[],"readme":"![MambaScript](https://user-images.githubusercontent.com/38284764/95914203-5f86c500-0d73-11eb-9e58-0ce19999ce13.png)\n---\n## Getting Started\n\nInstall and run!\n\n```\n$ npm install -g mambacript\n$ mamba -c foo.mamba # compile\n$ mamba foo.mamba # execute\n$ mamba # repl\n$ start-mambascript #start a new mambascript project\n```\n\n### Extensions you should know about MambaScript\n\n- `.mamba` are compiled by mambascript compiler.\n\n# Why work on an old project.\n\nThis project is amazing, period. Everything here is exactly what I needed to be added to KOFUJS project in order for it to run the way I want it to run, without having to move over to the clunky TypeScript syntax that I would rather avoid.\n\n## Fixes made\n\n1. Fixed Bug Causing REPL Not to Function\n1. Updated CoffeeScript to stable version 2.5+ with JSX support\n1. Added .mamba file type\n\n## Updates Coming\n\n1. Documentation on Usage with KOFUJS\n1. Updates to Create MambaJS App\n1. Make This Mambascript fork the default syntax for KOFUJS\n\n## Current Tasks\n\n1. Discover Additional Bugs\n1. Make Production Ready\n\n\u003chr/\u003e\n\n```iced\n\t# Concatenate string\n\tpresent '-------Concatenate string--------'\n\tpresent 'Concatenate --\u003e',  'con' + 'cat' + 'en' + 'ate'\n\n\t# typeof operator\n\tpresent '-------TYPEOF operator--------'\n\tpresent 'Typeof Operator --\u003e', typeof 'arthur'\n\n\t# isnt\n\tpresent '-------ISNT instead of !== --------'\n\tpresent 'ISNT --\u003e' , 'Love' isnt 'Hate'\n\n\t# and , \u0026\u0026 , also\n\tpresent '------- also --------'\n\tpresent 'ALSO --\u003e', 5 \u003e 3 also 6 \u003e 5\n\n\t# or, ||\n\tpresent '------- or --------'\n\tpresent 'OR --\u003e', true or false\n\n\t# not\n\tpresent '-------NOT--------'\n\tpresent not true\n\n\t# is  and Booleans\n\tpresent '------- is  and Booleans --------'\n\tpresent 'Truthy Booleans true, on, yes'\n\tpresent 'Falsey Booleans false, off, no'\n\tpresent true is on\n\tpresent true is yes\n\tpresent false is off\n\tpresent false is no\n\n\n\t# Types\n\n\tobj =  {\n\t\t\"MambaScript\":\t\"JavaScript\"\n\t\t\"is\": \"===\"\n\t\t\"isnt\":\t\"!==\"\n\t\t\"not\":\t\"!\"\n\t\t\"also\":\t\"\u0026\u0026\"\n\t\t\"or\":\t\"||\"\n\t\t\"true yes on\":\t\"true\"\n\t\t\"false no off\":\t\"false\"\n\t\t\"@ this\": \t\"this\"\n\t\t\"of\": \"in\"\n\t\t\"in\": \"no JS Equivalent\"\n\t}\n\n\tkeys :: String[] = Object.keys obj\n\n\tforEvery key in keys then present \"[#{key}] in MambaScript is equivalent to [#{obj[key]}] in JavaScript\" unless key is 'MambaScript'\n\n\t# Strings\n\n\tmyString :: String = 'arthur'\n\n\tpresent myString.split('').reverse().join('')\n\tpresent typeof myString\n\n\t# Numbers\n\n\tmyNumber :: Number = 5\n\n\tpresent 'myNumber is', myNumber\n\tpresent myNumber * 2\n\tpresent myNumber ** 2\n\tpresent myNumber % 3\n\tpresent myNumber / 2\n\n\n\t# Booleans\n\tmyBoolean :: Boolean = yes\n\tpresent 'myBoolean is', myBoolean\n\n\t# Objects\n\tmyObj =\n\t\tname: 'arthur'\n\t\tage: 32\n\t\tlights: on\n\t\thair: true\n\n\tpresent myObj\n\t# Arrays\n\tnumArr :: Int[] = [1,2,3]\n\tstringArr :: String[] = ['a', 'b', 'c']\n\totherArr :: Any[] = [1, 'a']\n\tpresent otherArr\n\n\t# Loops \u0026 Control Flow\n\n\tforEvery number in [0..12] by 2 then present number\n\n\tforEvery number in [0..10]\n\t\tdo (number) -\u003e\n\t\t\tpresent number * 3\n\n\t# eat is a function that accepts a string and returns nothing\n\teat :: String -\u003e () = (food :: String ) -\u003e\n\t\tpresent \"yum #{food.toUpperCase()} !!!\"\n\n\teat food forEvery food in ['toast', 'cheese', 'wine']\n\n\teat food forEvery food in  ['toast', 'cheese', 'wine'] when food isnt 'cheese'\n\t# Blueprints\n\n\tblueprint Human\n\t\tname :: String\n\t\tage :: Int\n\t\tconstructor: (age :: Int, name :: String) -\u003e\n\t\t\t@name = name\n\t\t\t@age = age\n\n\tblueprint SuperHero inheritsFrom Human\n\t\tname :: String\n\t\tage :: Int\n\t\tpowers :: String[]\n\n\t\tconstructor: (name :: String, age :: Int, powers...) -\u003e\n\t\t\tsuper name, age\n\t\t\t@powers = powers\n\n\tbigArt = new SuperHero 'Big Art', 33, 'flight', 'super strength'\n\n\tpresent bigArt\n\n\t# Functions\n\n\t# Structs\n\n\t# Generics\n\n```\n\nMambaScript Is Forked and Built On Top Of TypedCoffeeScript a Fork of CofffeScriptRedux\n==================================\n\n[Typed Coffee Script Details](https://github.com/mizchi/TypedCoffeeScript)\n[CoffeScript Redux Details and Contributors](https://github.com/michaelficarra/CoffeeScriptRedux/wiki/Roadmap)\n\nCoffeeScript with Types.\n\nThis repository is heavily under development and unstable. See below milestone.\n\n## Concepts\n\n* Structual Subtyping\n* Superset of CoffeeScript\n* Easy to replace coffee (pass unannotated coffee)\n* Pessimistic type interfaces\n\n## What is pessimistic type interface?\n\nTo pass dynamic type system, TypedCoffeeScript expects symbol to `implicit` node by default. If compiler compares implicit node type and implicit node type and fails, it recover to `implicit` `Any` automatically.\n\n## Examples\n\n### Assigment with type\n\n```coffee\nn :: Int = 3\n```\n\n### Pre defined symbol\n\n```coffee\nx :: Number\nx = 3.14\n```\n\n### Nullable\n\n```coffee\nx :: Number?\nx = 3.14\nx = null\n```\n\n### Typed Array\n\n```coffee\nlist :: Int[] = [1..10]\nlistWithNull :: Int?[] = [1, null, 3]\n```\n\nIn `v0.10`, imperfect to struct.\n\n### Struct\n\n```coffee\nstruct Point\n  @name :: String\n  x :: Number\n  y :: Number\np :: Point = {x: 3, y: 3}\nname :: String = Point.name\n\nstruct Point3d implements Point\n  z :: Number\n```\n\n### Module\n\nTypedCoffeeScript has module system like TypeScript\n\n```coffee\nmodule A.B\n\tclass @C\n\t\ta :: Int\nabc :: A.B.C = new A.B.C\n```\n\n### Typed Function\n\n```coffee\n# pre define\nf1 :: Int -\u003e Int\nf1 = (n) -\u003e n\n\n# annotation\nf2 :: Number -\u003e Point = (n) -\u003e x: n, y: n * 2\n\n# multi arguments\nf3 :: (Int, Int) -\u003e Int = (m, n) -\u003e m * n\n\n# another form of arguments\nf4 :: Int * Int -\u003e Int = (m, n) -\u003e m * n\n\n# partial applying\nfc :: Int -\u003e Int -\u003e Int\nfc = (m) -\u003e (n) -\u003e m * n\n```\n\n### Blueprint instead of class with this scope\n\n```coffee\nblueprint X\n  # bound to this\n  num :: Number\n  f   :: Number -\u003e Number\n\n  f: (n) -\u003e\n    @num = n\n\nx :: X = new X\nn :: Number = x.f 3\n```\n\n### Blueprint with implements\n\n```coffee\nblueprint Point\n  x :: Int\n  y :: Int\n\nstruct Size\n  width  :: Int\n  height :: Int\n\nblueprint Entity inheritsFrom Point implements Size\ne :: {x :: Int, width :: Int} = new Entity\n```\n\n### Generics and type arguments\n\n```coffee\n# struct\nstruct Value\u003cT, U\u003e\n\tvalue :: U\nstruct Id\u003cA, B\u003e\n\tid :: Value\u003cA, B\u003e\nobj :: Id\u003cInt, String\u003e =\n  id:\n    value: 'value'\n\n# function type arguments\nmap\u003cT, U\u003e :: T[] * (T -\u003e U) -\u003e U[]\nmap = (list, fn) -\u003e\n  for i in list\n    fn(i)\nlist :: String[] = map\u003cInt, String\u003e [1..10], (n) -\u003e 'i'\n\n# blueprint type arguments\nblueprint Blueprint\u003cA\u003e\n  f :: Int -\u003e Int\n  constructor :: A -\u003e ()\n  constructor: (a) -\u003e\nc = new Blueprint\u003cInt\u003e(1)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farthurbernierjr%2Fmambascript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farthurbernierjr%2Fmambascript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farthurbernierjr%2Fmambascript/lists"}