by fbgencer
Tiny lightweight multipurpose programming language written in C

Fbgc is a script language considers small code size and less memory allocations for its objects.

There is a gap between Matlab like numerical computing environments and Python like script languages. Albeit they have been used for different purposes, but people did not use them for real-time programs or where speed and memory is a problem. Fbgc aims to fill this gap. It is a tiny and a powerful language and can be used everywhere such as small projects, as a part of big projects or as a numerical computing tool.

Fbgc libraries were written from scratch, this allows developers to optimize codes as necessary and gives more space to realize what needs to be done.

Fbgc aims

  • Small program size
  • Low memory allocation
  • Numerical computing environment (scientific package)
  • Graphical User Interface for different purposes (including latex compiler and libreoffice programs to create an environment based on fbgc)

Features (for users):

  • Easy to learn and understandable syntax, similar to writing notes on a math notebook.
  • Memory friendly, does not consume your precious RAM.
  • Typeless and everything is object.
  • It has its own memory management system, hence garbage collector.
  • If users know C/C++, their code can be easily imported into fbgc.
  • Similar to well known languages, read the documentation and ready to go.
  • Supports classes, inheritance, operator overloading etc. (OOP features)

Features (for developers):

  • Basic C/C++ API functions, easy to import any C/C++ code into fbgc.
  • Every part of fbgc is written from scratch, main parts only need C standard library.
  • Libraries can be used in any other C/C++ projects.
# This is a line comment
x = 5 # integer
x = 3.14159 # double
x = 'Hey this is a string' # string
x = (1,2,1.23,('Hey i am tuple!')) # tuple
x = [1,2,3 ; 4,5,6] # 2x3 matrix

# Conditional structures
if x == 5 & x != "fbgc" 
elif x != 3.2
    print("inside elif")

#For loops 
for i = 1:0.1:5

#Strings and tuples are also iterable in for loops
x = (5,"a","c","x")
for i = x
    print(i) # prints 5, 'a', 'c', 'x'

#function definition
is_even = fun(x)
     return x % 2 == 1

#class definition, fbgc allows nested classess
car = class()
     power = 0
     tires = 4
     engine = class()
          health = 100
     init = fun(p,t)
          .power = p
          .tires = t
     #operator overloading
     #now car objects can use subscript operator

     __[]__ = fun(x)
         return power*x


#Importing a library

load('math','*') # loads everything from math library into globals scope 

load('math','pi','sin') # loads only sin and pi from math library into global scope

m = load('math') # loads math library into variable m, hence library variables can be used via m e.g m.sin() or m.pi
Information updated 07/18/20
View Comments