{"id":41403912,"url":"https://github.com/tlaceby/bedrock","last_synced_at":"2026-01-23T13:17:54.536Z","repository":{"id":233201828,"uuid":"771314731","full_name":"tlaceby/bedrock","owner":"tlaceby","description":"Bedrock is a statically typed programming language designed to provide a solid foundation for building general-purpose computer programs. ","archived":false,"fork":false,"pushed_at":"2025-04-06T04:26:18.000Z","size":9125,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-08T00:14:47.830Z","etag":null,"topics":["bytecode-compiler","language","staticaly-typed","vm"],"latest_commit_sha":null,"homepage":"","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/tlaceby.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}},"created_at":"2024-03-13T04:20:24.000Z","updated_at":"2025-04-29T11:43:05.000Z","dependencies_parsed_at":"2024-04-15T17:50:38.361Z","dependency_job_id":"ef5493f1-40ac-40f2-beaf-508b8feb851a","html_url":"https://github.com/tlaceby/bedrock","commit_stats":null,"previous_names":["tlaceby/bedrock"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tlaceby/bedrock","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tlaceby%2Fbedrock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tlaceby%2Fbedrock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tlaceby%2Fbedrock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tlaceby%2Fbedrock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tlaceby","download_url":"https://codeload.github.com/tlaceby/bedrock/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tlaceby%2Fbedrock/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28693256,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T11:01:27.039Z","status":"ssl_error","status_checked_at":"2026-01-23T11:00:26.909Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["bytecode-compiler","language","staticaly-typed","vm"],"created_at":"2026-01-23T13:17:54.456Z","updated_at":"2026-01-23T13:17:54.521Z","avatar_url":"https://github.com/tlaceby.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bedrock **(.br)**\n\nBedrock is a statically typed programming language designed to provide a solid foundation for building general-purpose computer programs. With a syntax inspired by Rust, Go, and C#, Bedrock aims to be simple, concise, and easy to use while offering powerful modern features.\n\n## Examples\n\nHere's a simple program showing off some features of the language.\n\n```rs\n// Imports\nmod main; // the entry point must be mod main\nimport(\"std/slices\") as slices;\nimport(\"../lib/foo.br\") as foo;\n\n// Variable Declataions \u0026 Assignemnts\nlet foo: Number; // cannot be used until value is assigned\nlet bar: String = \"Hello world\";\n\nfoo = 10.2;\n\n// foo = \"This would cause an error\"; -\u003e Invalid Types\nconst foobar: String = @string(foo) + bar;\nconst pi = 3.14;\n\n// Conversions \u0026 Casts\nconst angle = pi * 2;\nconst message: String = \"The angle is \" + @string(angle);\n\n// Polymorphism\ntrait Stats {\n  fn displayStats () -\u003e Void;\n}\n\nstruct Person {\n  name: String;\n  age:  Number;\n\n  // Methods which must be implimented before struct can be created/used.\n  fn displayStats () -\u003e Void;\n  static fn new (name: String, age: Number) -\u003e Self;\n}\n\nimpl Person {\n  fn displayStats () -\u003e Void {\n    println(\"Age: \"   + @string(age));\n    println(\"Speed: \" + @string(speed));\n  }\n\n  static fn new (name: String, age: Number) -\u003e Self {\n    return Person{\n      name, age,\n    };\n  }\n}\n\nstruct Animal {\n  breed: String;\n  age:   Number;\n  speed: Number;\n\n  fn displayStats () -\u003e Void;\n}\n\nimpl Animal {\n  fn displayStats () -\u003e Void {\n    println(\"Breed: \" + breed);\n    println(\"Age: \"   + @string(age));\n    println(\"Speed: \" + @string(speed));\n  }\n}\n\nlet thingsWithStats: []Stats{\n  Person::new(\"Tyler L\", 24),\n  Animal{\n    breed: \"Dog\",\n    age: 10,\n    speed: 4.3,\n  }\n};\n\nfor value in thingsWithStats {\n  value.displayStats();\n\n  // How to access the underlying type.\n  match value {\n    .Person {\n      println(\"It'a a Person{}\");\n    },\n    .Animal {\n      println(\"It's a Animal{}\");\n    }\n  }\n}\n\n// Functions\n\nfn add (x: Number, y: Number) -\u003e Number {\n  return x + y;\n}\n\n// Variadic function. Expects atleast 2 arguments\nfn min (a: Number, b: Number, dyn args: []Number) -\u003e Number {\n  let minFound: Number = a;\n\n  if b \u003c a {\n    minFound = b;\n  }\n\n  for el in args {\n    if el \u003c minFound {\n      minFound = el;\n    }\n  }\n\n  return minFound;\n}\n\nadd(10, 20); // 30;\nmin(1, -25); // -25\nmin(1, 2, 3, 4, 5, 0); // 0\n\n// Slices\n\nlet numbers: []Number = []Number{ 1, 2, 3, 4 };\nnumbers = slices::append(numbers, 10); // slices are fixed in size. No resizing without build in methods\nnumbers[4] = 5;\n\nprintln(@string(numbers)); // [1, 2, 3, 4, 5]\n\n// Constant size slice. No resizing\nconst BUFFER_SIZE = 1024;\nconst buffer = [BUFFER_SIZE]Number{};\n\nslices::fill(buffer, 1);\n\nif slices::every(buffer, 1) {\n  println(\"Every value is a 1\");\n} else {\n  panic(\"Something went wrong. Slice should have all 1's\");\n}\n\n// Will set each element in the buffer to it's index [0, 1, ... 1023]\nslices::map(buffer, fn (indx: Number, _: Number) -\u003e Number {\n  return indx;\n});\n\n// Errors (IN-PROGRESS)\n\n// Assert will panic if the size is not met\n@assert(len(buffer), BUFFER_SIZE);\n\n// assert_or lets you handle errors with a callback\n@assert_or(len(buffer), BUFFER_SIZE, fn () {\n  println(\"Buffer not the proper size\");\n});\n\n\n// Unsafe Actions\nunsafe {\n  const moreThingsWithStats: []Stats{\n    Person::new(\"Tyler L\", 24),\n    Animal{\n      breed: \"Dog\",\n      age: 10,\n      speed: 4.3,\n    }\n  };\n\n  // You can only perform an unsafe_cast inside a unsafe scope\n  let person = @unsafe_cast(Person, moreThingsWithStats[0]);\n  let animal = @unsafe_cast(Animal, moreThingsWithStats[1]);\n\n  person.name = \"John Doe\";\n  animal.speed = 1.2;\n}\n\n```\n\nBedrock is open-source software licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftlaceby%2Fbedrock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftlaceby%2Fbedrock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftlaceby%2Fbedrock/lists"}