{"id":51590567,"url":"https://github.com/bentimor/budcore","last_synced_at":"2026-07-11T14:02:44.710Z","repository":{"id":255652261,"uuid":"853296022","full_name":"BenTimor/BudCore","owner":"BenTimor","description":"A modern, async-first and business-first programming language in the JavaScript ecosystem","archived":false,"fork":false,"pushed_at":"2024-09-18T07:38:18.000Z","size":178,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-09-19T05:55:46.032Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BenTimor.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":"2024-09-06T11:28:50.000Z","updated_at":"2024-09-18T07:38:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"0545103e-ee10-45af-9b56-f65eac64de46","html_url":"https://github.com/BenTimor/BudCore","commit_stats":null,"previous_names":["bentimor/budcore"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BenTimor/BudCore","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenTimor%2FBudCore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenTimor%2FBudCore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenTimor%2FBudCore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenTimor%2FBudCore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BenTimor","download_url":"https://codeload.github.com/BenTimor/BudCore/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenTimor%2FBudCore/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35364269,"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-07-11T02:00:05.354Z","response_time":104,"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":"2026-07-11T14:02:43.828Z","updated_at":"2026-07-11T14:02:44.705Z","avatar_url":"https://github.com/BenTimor.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bud General Concepts\n\nBud is a programming language which is compiled to TypeScript and JavaScript. The language is similar to TypeScript.\n\nWhen reading this document, consider the concepts as changes to TypeScript and not as a full language declaration. Most of the things that are not specified here are similar to TypeScript. A more proper documentation will be written in the future.\n\nAdditionally, the language doesn't exist yet, and this document is only my initial thoughts about how it should look. It might change during development.\n\n## Async First\n\nAll of the operations in Bud are asynchronous from the developer's perspective. There are no synchronous operations.\n\nBud might perform synchronous operations behind the scenes though.\n\n## Await First\n\nBud always waits for asynchronous operations to complete and blocks the current block until specified otherwise.\n\nThe action of **not** waiting for something is called *freeing* because it's freeing the operation from the current block. \n\nIn order to *free* an operation we'll use the `free` word. For example, freeing a function named 'banana' will look like this:\n\n```ts\nfree banana();\n```\n\n## Expression Oriented\n\nIn Bud everything is an expression and returns a value. For example, you can assign a conditional value to a variable like that:\n\n```ts\nvariable = if (expression) {\n\treturn \"hello\";\n}\nelse {\n\treturn \"world\";\n};\n```\n\n## Block Identifier \n\nEvery block of code might have an optional scope-unique identifier. This identifier can be used later for all sort of things.\nFor example, an identifier will let you know how much time a block was executed. \n\n```js\nif (expression1) first: {\n\t//\n}\n\nif (expression2) second: {\n\t//\n}\n\nif (first.executed \u0026\u0026 second.executed) {\n\t// \n}\n```\n\n## Happy Flow Last\n\nBud will have lots of options to allow you to move inside and outside of blocks. This way you can handle validations, edge cases and non-happy flows first. Then when you finish with all of them, you can break out of their block and get to the happy flow.\n\nThis way the code is a lot more readable and maintainable. \n\nThose options include:\n\n1. `break` and `continue` will always perform the action on the current block. Doesn't matter if the block is connected to a loop or not.\n2. `break` and `continue` will be able to get an optional `[name]` parameter. This parameter will allow you to perform those actions on another block of code.\n\nAn example for a code with *Happy Flow Last* in mind:\n\n```js\nfor (val of arr) main: {\n\tif (type issues): issues {\n\t\tif (can be converted) {\n\t\t\tval = convert val;\n\t\t\tbreak issues ; // Gets us back to the for loop block\n\t\t}\n\t\t\n\t\tif (type we can skip) {\n\t\t\tcontinue main; // Jumps to the start of the for loop\n\t\t}\n\t\t\n\t\tbreak main; // Breaks out of the for\n\t}\n\n\twhile (val) {\n\t\t// operations\n\t\tcontinue main; // Jump to the start of the for loop\n\t}\n\t\n\t// Happy flow business logic comes here\n}\n```\n\n## Everything Can Be Proxied\n\nLet's say you just created a variable, and you want to perform a side effect every time this variable is changed. You will be able to proxy the variable and modify its behavior. Like that:\n\n```js\nvariable = 1;\n\nproxy variable {\n\tset(v) {\n\t\t// run side effect\n\t\treturn v; // Returns the value that should be set\n\t}\n}\n```\n\nYou'll be able to add more proxies on a proxied variable. The first proxy you add will be the first to run, the last will be the last to run.\n\n## Function Caching\n\nFunctions can cache their returned value in order to prevent them from calculating again static values that will never change. \n\nAs a default mechanism, you can just add the `cache` command to the function definition, and then the next time the function will be called with the same parameters the last returned value will be returned.\n\n\u003e (Open question: What's considered as 'same parameters'?)\n\nFor example:\n```ts\ncache add(a, b) {\n\treturn a + b;\n}\n\nadd(1,2); // Calculating the value and returning 3\nadd(1,2); // Returning the value 3 from caching\n```\n\nAnother option is to cache function results by specific identifiers. This way, you can tell Bud to cache every value as long as those parameters stay the same. This works by passing an object to the `cache` command. Like that:\n\n```ts\n// As long as either the user's id or the user's phone and mail matching the cache, returns from cache\n// (id in cache) OR (phone in cache AND mail in cache) return user from cache;\nreadUserFromDB(identifiers) {\n\tcache { phone: identifiers.phone, mail: identifiers.mail };\n\tcache { id: identifiers.id };\n\t// logic\n\treturn user;\n}\n```\n\nThe `cache` command can be put anywhere inside the function, and whenever Bun will reach this value, it'll check if it can match anything from the cache to return.\n\nIf you called the `cache` command and nothing is cached for those values, Bud will make sure to cache the value for those parameters when the function returns something.\n\n## Documentation\n\nIn Bun you can document pretty much everything. For example:\n\n1. Functions' purpose\n2. Parameters' description and examples\n3. Return values\n\nAnd possibly more.\n\n## Reflection (for AI tooling for example)\n\nBun supports reflection features which allow you to convert functions to tools which can be used by APIs. You can do all sort of things like:\n\n1. Getting the information about the parameters of a function - including their types and their description.\n2. Getting the description of a function.\n3. Invoking a function using raw data.\n\nFor example:\n```ts\nadd(a: number, b: number) {\n\treturn a + b;\n}\n\nadd.parameters[\"a\"].type; // returns \"number\"\n\nadd.invoke({ a: 1, b: 2 }); // returns 3\n```\n\n## Other Ideas to Think About\n\n1. An option to rerun functions in case of exceptions\n2. An option to rewrite a function in case of exception, and execute the new function instead\n3. Caching options (caching for X amount of time, connecting to external services, clear caching, force recache)\n4. Event system\n5. Decorators\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbentimor%2Fbudcore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbentimor%2Fbudcore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbentimor%2Fbudcore/lists"}