Quinne is a framework to create a new Domain-Specific programming language(DSL)
Goal: To make it easier to create a new domain-specific language for your own purposes, with this new language, you can get these advantages:
- Efficient communication: Developers can communicate with other teams in this new, less complicated, easier-to-understand language, so participators from different teams can reach an agreement shortly.
- Declarative Programming: Most Business rule engines can be created by using logic branches and functions(actions) in a declarative manner, which is a better way to express solutions to difficult problems and domain experts can easily read and verify a set of rules.
- Knowledge Centralization: You can build a repository of knowledge, which is executable and strongly tied to the backend code and data, so it will be the most up-to-date version of business logic and can be served as documentation.
- Logic and Code Separation: Code and data reside in the actual backend realization and business logic resides in the frontend DSL, meaning domain experts can focus on domain problems and developers can focus on code design and optimization.
- Customized Grammar: With Golang's basic grammar combined with python style try-catch, and Lamba grammar, developers can write shorter programs with enhanced functionalities by using functional programming.
More Readings:
go get -u github.com/Quinn-Fang/quinne
package main
func main() {
Platform := "aws"
Authenticate()
Ret := CreateEKSCluster("EKSCluster-1", 3)
additionalNodeCount := lambda currentNode, expectedNode int: expectedNode-currentNode if expectedNode > currentNode else 0
currentNodeCount := getCurrentNodeCount()
expectedNodeCount := 6
additionalNode := additionalNodeCount(currentNodeCount, expectedNodeCount)
expandEKSCluster(additionalNode)
}
package directional
func main() {
activateVehicle("Mercedes_1")
weather := GetWeatherStatus()
if weather == "raining" {
showNotificationOnDevice("IPhone_device_1", "it's raining heavily, bring umbrella")
driveToDestination("pandas_1")
} else if weather == "snowing" {
showNotificationOnDevice("Apple_watch_device_2", "it's snowing, wear more clothes")
driveToBackDoor()
openBackDoor()
driveToCompany()
}
}
package directional
func main() {
getUserPhoneNum()
checkUserExistance()
if exists {
ssoStatus := checkSSOStatus()
ssoLogin(ssoStatus)
} else {
createNewUser()
userStatusConfirm()
userLogin()
}
}
package directional
func main() {
getUserInfo()
if isNewUser() {
expireDate := "2022-7-31"
amount = 3
sendCoupon(amount, expireDate)
if isDriver() {
amount = 10
expireDate := "2023-7-31"
sendCoupon(amount, expireDate)
}
} else {
if isUnderBadWeather() {
amount = 10
expireDate := "2023-7-31"
nodificationMsg := "Bad weather coming!"
sendCoupon(amount, expireDate)
sendNotification(nodificationMsg)
} else {
}
if OpenApp() {
time := getLocalTime()
sendMsgByTime(time)
}
}
}
package samples_001
func main() {
create_battery()
create_switch()
if SWITCH_ON {
create_bulb("bulb-1")
} else {
create_bulb("bulb-2")
}
}
package graph
func main() {
searchForTreeNodeWithValue(36)
if treeNodeExists {
if rearrangeRequired {
rearrangeTreeStructure()
insertNewValue()
} else {
insertNewValue()
}
} else {
createTreeNode()
}
}