Installing BasedLang

Install BasedLang

Requirements

  • Access to a command-line interface (CLI) or terminal.
  • Windows, MacOS, or Linux.
  • Installation of Python 3.x

From your terminal, enter

curl -fsSL https://basedlang.com/install.sh | sh

BasedLang "Hello World" Example

-- Define a variable
let x = 5
 
-- Print the variable
print x
 
-- Define a function
def addOne = ( + x 1 )
 
-- Use the function
print addOne
 
-- Loop from 1 to 3
loop i = [1,3]
  -- Inside the loop, print the current value of i
  print i
 
-- Import a library
import math
 
-- Use the imported library
let pi = math.pi
print pi
 
-- Define a model
model myModel = "text-davinci-003"
 
-- Define a context
context myContext = "This is a sample context for the model."
 
-- End of BasedLang example file