Open-source transpiled programming language that helps you write clean code, well-designed systems, and build high-quality software that is testable, auditable and maintainable. Like what you see? Don't forget to star! :star: ^^^
Quick Start | Benefits | Why? | Goals | Project Status | Discord | GitHub Discussions | GitHub Issues | Contributing
Bitloops Language (BL) is a high-productivity, domain specific language (DSL) that helps you focus on the business logic of your application which is what really matters.
It incorporates software development best practices and design methodologies such as DDD, BDD and Layered/Hexagonal Architecture.
The Bitloops Language guides and empowers any software developer to write clean code and build high-quality & well designed software. This is particularly relevant for server application software that has complex, and frequently changing business requirements. With BL, developers can build software using principles such as separation of concerns, loose coupling, high cohesion and command query responsibility segregation (CQRS), which ensure systems are easier to understand, maintain and change.
With Bitloops Language, developers are able to:
In essence, software developers can focus on what they do best: solving problems! With the Bitloops Language developers write code that will allow other developers (and even themselves after 6 months) to easily understand and build on top of that code.
Β
β οΈ Please keep in mind that the Bitloops Language is in its early stages and under very active development. Expect bugs and limitations. Any backward compatibility is not guaranteed before reaching v1.0.0.
Β
The best and fastest way to understand how the Bitloops Language helps you write clean code and great software is to follow the instructions below. With this tutorial, you will run and execute a Bitloops ToDo App, learn how Bitloops works, and see the output files in TypeScript and appreciate how the Bitloops Language works.
If you face any issues (especially with Windows) check the Common Issues Section below.
Bitloops still hasn't created binaries, so the best way to install and run the transpiler is to install the Bitloops Language CLI as a global npm package. Copy the following and run it in your IDE:
npm install -g @bitloops/bitloops-language-cli
Alternatively, you can use yarn:
yarn global add @bitloops/bitloops-language-cli
The Bitloops ToDo App is readily available for cloning. You can extract the files following the link or clone it using the command below:
git clone https://github.com/bitloops/bitloops-language.git
The next step is to transpile the ToDo App code from Bitloops Language Code into TypeScript code. Transpile comes from the word Transcompile, and means the translation of code from one programming language to another.
macOS / Linux
bl transpile -s bitloops-language/examples/todo/bl-source/ -t output
Windows
bl transpile -s bitloops-language\examples\todo\bl-source\ -t output
or
bitloops-language transpile
That's it! You can now run the following to see how many lines of code you saved yourself (spoiler alert: 77% or 2141 LoC!)
bl analyze-lines -bl bitloops-language\examples\todo\bl-source -ts ./output
Ok now you have all your business logic beautifully transpiled into well structured TypeScript code πππ!
The scope of the Bitloops Language ends here but using Bitloops you can automatically generate everything else using Bitloops magic and AI! Bitloops will generate for you a Nest.js project and all the required infrastructure (gRPC or REST controllers, repository adapters for PostgreSQL or Mongo etc.) as well as docker or K8s files to deploy your system. To learn more about the automatic Bitloops process [click here].
Alternatively, you are free to use any framework you like or just an Express server or Fastify server etc.
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
There are numerous great programming languages out there with massive and growing codebases and investments. However, the most common problem faced by organizations that build and maintain systems, with teams of developers working on them, is good architecture and design of an interconnected system of services;
Designing a complex system so that it can last through time and will allow developers (existing and new joiners) to work on its codebase with steady (or hopefully) increasing productivity is very difficult.
Good testing is an additional major requirement of long lasting products which is also made possible by good architecture and design. Unfortunately, there aren't enough knowledgeable and experienced senior engineers around the world to build and maintain great systems for all who need them. Even when a company is lucky enough to have some, it is unable to hire more junior engineers than the senior ones can review their work and guide in order to make sure the system does not degrade over time due to bad design decisions.
The Bitloops Language is the first programming language that aims to address these issues by making it much easier to adopt important software engineering principles and patterns such as Domain-Driven Design and Behavior-Driven Development, without requiring many years of experience to do so successfully. As a result, the work of senior engineers can be further leveraged and the contributions of junior engineers significantly boosted.
Every software engineer has a common goal: we want to write better code and build better software, and we want to do this faster!
However, this can only be achieved with significant and continuous dedication, learning and experience, which takes a lot of time. Bitloops wants to significantly reduce the time it takes a developer to start building high-quality software, and we have built the Bitloops Language that already incorporates many of the software development best practices and design methodologies.
Ultimately, BL's goals are to:
The Bitloops Language aims to define and retain a simplistic syntax that will be as close to human language and business logic as possible that will become timeless, helping adopt and use a ubiquitous language within each module or bounded context. It is then BL's job to transpile into modern and up-to-date syntax of your target language.
Making the Bitloops Language a transpiled language was a core decision to achieve exactly this. By allowing oraganisations to write their business logic in a timeless language that can be transpiled to powerful but also changing target languages without burdening the users of the Bitloops Language with this task. The Bitloops Language will make sure it transpiles to optimized code of relevant, up-to-date, and right-for-the-task languages.
The Bitloops Language is currently in early stages. Its transpiler has been created as a proof of concept and is not meant to cover the full range of developer creative code writing at this stage.
We want to better understand whether we can build a language that meets your needs, and whether we can gather a critical mass of interest within the DDD community and outside of it.
There are many things we want to add in the future including
If you're interested in contributing, we would love your help!
If you are already aware of the DDD concepts (Aggregates, Value Objects, Use Cases, Controller, etc.) and know how to code in any modern programming language, it should be really easy to pick up the Bitloops Language. It is built out of a consistent set of language constructs that should feel familiar and be easy to read and understand.
While Bitloops is an Object Oriented Language, it doesn't have a generic class. Specific Bitloops classes are build-in as follows: ValueObject, Entity, Root Entity, Command, CommandHandler, Query, QueryHandler, DTO, Props, OK, ApplicationError, DomainError, Error etc.
Bitloops Language code like this (11 lines):
// Bitloops Language:
Rule TitleOutOfBoundsRule(title: string) throws DomainErrors.TitleOutOfBoundsError {
isBrokenIf(title.length > 150 OR title.length < 4);
}
Props TitleProps {
string title;
}
ValueObject TitleVO {
constructor(props: TitleProps): (OK(TitleVO), Errors(DomainErrors.TitleOutOfBoundsError)) {
applyRules(TitleOutOfBoundsRule(props.title));
}
}
transpiles to this TypeScript code (28 lines):
// TypeScript:
import { Domain, Either, ok, fail } from '@bitloops/bl-boilerplate-core';
import { DomainErrors } from './errors';
export class TitleOutOfBoundsRule implements Domain.IRule {
constructor(private title: string) {}
public Error = new DomainErrors.TitleOutOfBounds(this.title);
public isBrokenIf(): boolean {
return this.title.length > 150 || this.title.length < 4;
}
}
export namespace Rules {
export class TitleOutOfBounds extends TitleOutOfBoundsRule {}
}
interface TitleProps {
title: string;
}
export class TitleVO extends Domain.ValueObject<TitleProps> {
get title(): string {
return this.props.title;
}
private constructor(props: TitleProps) {
super(props);
}
public static create(props: TitleProps): Either<TitleVO, DomainErrors.TitleOutOfBounds> {
const res = Domain.applyRules([new Rules.TitleOutOfBounds(props.title)]);
if (res) return fail(res);
return ok(new TitleVO(props));
}
}
For questions and support please use our official Discord channel. Feel free to join if you're looking to learn more about software development design patterns.
We are a small team on a mission to democratize well-designed code and high-quality software, and we'll take all the help we can get! If you'd like to get involved, please check out our Contribution Guidelines to learn how and where we could use your help. We aim to identify good-first-issues so you can quickly start contributing and learning.
Please make sure to read our Reporting Issues guidelines before opening an issue. Issues not conforming to the guidelines may be closed immediately.
For general help using Bitloops Language, please use one of these channels:
Bitloops Language has a GNU General Public License v3.0. See the LICENSE file for licensing information.
Bitloops is always looking for great people to contribute to the Bitloops Language and Platform. If you're keen on joining a team that wants to radically improve how software is built going forward, then send your CV + Cover Letter (very important) + GitHub Profile to: [email protected]