GitHub Page : https://jennashea.github.io/snekql/
SnekQL is a multi-paradigm query language oriented towards data science. Pragmatic and intuitive, our language is intended to provide a simple yet powerful way of manipulating (representing & visualizing) data.
SnekQL's development group includes Jenna Berlinberg, Brandon Golshirazian, Alvin Lai, Imani Martin, Qiyue Aixinjueluo, and Jared Rebuyon.
- Dynamically Typed
- Optional Parameters
- Pass-by-reference Values
- No Pointers
- Weakly Typed
truthy = true
falsy = false
doubleValue = 5.0
integerValue = 42
stringValue = "Hello, There!"
array = [2, 3, 4]
array[1] # 3
fnc helloWorld():
hiss("Hello World")
rule1 = @ > 0 # @ represents the variable to be passed in.
rule2 = @ == "Jenna"
firstName = column("name", ["Jenna", "Jared"], true, false)
firstName.name # 'name'
firstName.value # ["Jenna", "Jared"]
firstName.notNull # true
firstName.unique # false
firstName.addRow("Brandon") # ["Jenna", "Jared", "Brandon"]
firstName.addRule(@ != "Jenna") # Rule 1 not satisfied for row 1.
groupName = tabulate(firstName, lastName)
groupName.columns # [firstName, lastName]
groupName.addColumn(middleName) # [firstName, lastName, middleName]
groupName.addRow(["Jenna", "Berlinberg", "Shea"])
groupName.dropColumn(lastName) # [firstName, middleName]
groupName.addRule(firstName, @ != "Jared")
groupName.addRow(["Jared", "Matthew"]) # Rule 1 not satisfied for new row
addition = 9 + 10 # 19
subtraction = 5 - 1 # 4
subtraction += 1.0 # 5.0
addition -= 3 # 16
greeting = "Hi"
let = 't'
please = greeting + let # 'Hit'
please += ' me' # 'Hit me'
multiplication = 7 * 81 # 567
division = 54 / 6 # 9
modulus = 79 % 11 # 2
division *= 3 # 27
multiplication /= 21 # 27
batman = "Na" * 20 # "NaNaNaNaNaNaNaNaNaNaNaNaNaNaNaNaNaNaNaNa"
22 > 1
5.2 != 4.9
truthy = true and true
falsy = not true
uni = "Loyola Marymount"
arr = [1, 2, 3, 4, 5, 6]
for i in uni:
hiss(i)
for i in range(4):
hiss(i)
for i in arr:
hiss(i)
j = 10
naught = 0.0
while true:
naught += 2.7
j -= 1
k = 100
l = 62
if k == l:
hiss("Values are Equal")
else
someEqualizerFunc(k, l)
if k - l == 38:
hiss("Values are Equal")
hiss("Values are Equal") if k -l == 38 else anotherEqualizerFunc(k, l)
fnc areaOfACircle(radius):
pi = 3.14
return pi * radius ** 2 # Precendence follows PEMDAS
numberOfTerms = 10
array = []
fibonacciNumbers = column("Numbers", array, True, True)
fnc fibonacci(n):
if n <= 1:
return n
else:
return(fibonacci(n-1) + fibonacci(n-2))
fnc addValuesToColumn():
for i in range(numberOfTerms):
array.add(fibonacci(i))
legAValues = []
legBValues = []
hypotenuseValues = []
legsA = column("Legs", legAValues, True, True)
legsB = column("Legs", legbValues, True, True)
hypotenuses = column("Hyptonuses", hypotenuseValues, True, True)
pythagoreanTriples = tabulate(legsA, legsB, hypotenuses)
fnc pythagoreanTriplets(limit):
hypotenuse = 0
two = 2
while hypotenuse < limit:
for i in range(1, two) :
legA = two * two - i * i
legB = 2 * two * i
hypotenuse = two * two + i * i
if hypotenuse > limit:
break
legsA.addRow(legA)
legsB.addRow(legB)
hypotenuses.addRow(hypotenuse)
two += 1
pythagoreanTriplets(20)
array = [32, 7, 60, 100, 5]
digits = column("Double Digits", array, True, True)
fnc removeSingleDigitValues(oldColumn):
parsedColumn = oldColumn
i = 0
for i in oldColumn:
parsedColumn.addRow(oldColumn[i])
return parsedColumn
removeSingleDigitValues(digits)
values = column("List of Numbers", [22, 23434, 2332, 7543, 10132], True, True)
fnc bubbleSort(column):
length = 0
switch = true
for i in column:
length += 1
while switch:
switch = false
for i in range(length - 1):
if column[i] > column[i + 1]:
temp = column[i]
column[i] = column[i + 1]
column[i + 1] = temp
switch = true
bubbleSort(values)
- Removed unreacheable return statements within functions
- Removed function declarations with no calls
- use of undeclared variable
- redeclaration of declared variable
- non boolean while condition
- non integer boolean condition
- non integer in add
- non integer in subtract
- types do not match in inequality test
- too many function arguments
- too few function arguments
- wrong type of function argument
- member of nonrecord
- subscript of nonarray
- call of nonfunction
- not iterable type
- array not all same type
- return must be inside a function
- break must be inside a function
- Rule not proper expression type