/FreakC

FreakC Programming Language - an experimental Batch-like language written in Batch which compiles to Batch

Primary LanguageBatchfileGNU General Public License v3.0GPL-3.0


An experimental programming language

language GitHub stars Windows

Note

I have taken a little break from FreakC and Batch coding as a whole, I might do a rewrite for FreakC in the future when I'm free.

Other than that, I'm working on JeChain, check it out if you are interested!



What is FreakC ?

print[] Hello, World.

FreakC is a nice, little, multi-paradigm programming language, which looks like Batch, compiles to Batch and is written in Batch as well. It is mainly built to be an experimental project with the idea of creating a programming language in such a limited language like Batch, but then it turns out that FreakC has added a little bit of features to Batch that might come in handy for some Batch developers. Batch's commands should work with FreakC most of the time, however, there are some quirks you should consider checking out which I have mentioned in the next part of this document.

And yes, this is not a C dialect, it's more like C in ArnoldC.

Language preview

Hello World:

print[] Hello, World!

Function definition:

function[] SayHello
    print[] Hello
endfunc[]

:: Calling "SayHello" function, printing out "Hello"
SayHello[..]

:: This will also work, because Batch's commands work in FreakC:
call SayHello

Class-based object-oriented programming:

:: Create a class called "Dog"
class[] Dog
    :: Init method
    method[] init
        var[] $this.age=%~2
        var[] $this.weight=%~3
    endmethod[]
	
    method[] BeingCute
        print[] *Being cute*
    endmethod[]
endclass[]

FreakC's commands end with [] or a special operator to indicate that it's FreakC code, so it doesn't cause confusion with Batch codes in your code.

More samples Join the small community on Discord!!!

Switching from Batch to FreakC

While FreakC is compatible with Batch, but it's not 100% compatible, you just need to replace all ! with ^!, ^^! with ^^^^^! (the second one is only required in enabled delayed expansion). If you use codes that depends on blank lines, then just change them to the ! character to create a blank line entirely, or just use Batch's ^.

FreakC's added features compared to Batch

  • While loops, repeat-until loops, and FreakC's own for loops with break/continue supports.
  • Switch cases.
  • Class-based OOP.
  • A bunch of utility functions for you to use.
  • Inline functions.
  • Macros.
  • Some minimal operators.
  • Floating-point numbers.
  • Some additional commands.

There are still more! Get started now!

Stuffs you would expect from a scripting language

  • Multi-paradigm (procedural, object-oriented, data-oriented...).
  • General purpose.
  • Dynamically typed.
  • Short, simple, packed with utility functions to help coding easier.
  • Easy to set up and use since it's written in Batch, you can just download the compiler and start coding.
  • Extremely light compiler which weighs less than 40kb!

Should you use FreakC?

  • As a Batch developer: Sure, but be aware that this project is still in BETA, and hasn't reached 1.0.
  • As a open-source developer: You can 100% use my code for your project, but please follow the conditions from GPLv3 License, and at least credit me in the README.
  • As a beginner to programming: No, just no, Batch and FreakC are things created by dark magic.
  • AS a real deal programmer: No, Batch and FreakC are slow and weird, their community is small, and there are not much good frameworks out there.

Todos

  • Concurrent model.
  • More utility functions.
  • Nicer inheritance and polymorphism for OOP.

What comes with the devkit ?

  • A compiler.
  • A command line shell.
  • A command line interface.
  • Some utilities.
  • Some examples.

Language resources

Frameworks and libraries

Official FreakC's frameworks

  • discord.fclang - A discord api wrapper built on top of Discord.net, can be used for bot dev.

Cool Batch frameworks/libraries

  • Number.cmd - A library for evaluating floating point number.
  • Discord.bat - A discord api wrapper built on top of Discord.net, can be used for bot dev.

Batch game frameworks

There are many existing game engines for Batch/FreakC:

Contribute

We would love to have you as a contributor! Please consider checking out contribution guidelines first!

Support the project!

If you like FreakC, it would be great if you leave a star here ❤️. I'd love if you follow me as well 😘.

To push the project's development faster, I'd love if you buy me a coffee by sending me some cryptos into my BEP-20 wallet: 0x1848Ba922d6eD66D4910176998fF4fa77AEb82D5

Sponsors

  • Top sponsor: @anapple96

Resources

Languages based on FreakC

I've created this tiny language for Vietnamese using the FreakC's codebase:

Contributors

  • Owner/Developer: @nguyenphuminh.
  • VSCode contributor: @anapple96.

Repo's contributors

Copyrights and License

Copyright © 2020-2021 Nguyen Phu Minh published under the GPLv3 License