Skip to content

Latest commit

 

History

History
96 lines (83 loc) · 3.38 KB

index.md

File metadata and controls

96 lines (83 loc) · 3.38 KB

LangTrans is a developer tool to customize syntax of any programming language.

Benefits

  • Code in your style
  • No need to create a new compiler/interpreter to use your preferred syntax
  • You can develop whole syntax or extend it with existing compiler/interpreter of any language
  • Code faster with your dialect for your domain
  • Knowledge about regular expression is the only prerequisite

Example

Python

#Print
p"Hello World"
# Anonymous function
inc = (x) => x+1
# Lambda function
twice(x) = 2*x
# Single Line try-except
try inc("1") Exception print("Error:",err)
# Print Done if x is defined other wise Failed
print((x||True)?"Done":"Failed")
# Single Line if and check x defined or not
print('x is not defined') if !x
# Pipe Syntax
1 -> inc
|> print
# Reverse Pipe
print<-inc<-inc<-1
# Arithmetic operations with functions 
print((inc+twice)(3))
#Scope syntax work like in javascript
#scope1#
print("Scope1")
print("Done")

#scope2#
print("Scope2")
print("Done")

#PEP 359 - The "make" statement 
make type name(arg):
	x = 1
	if x == 1:
	    pass
	y = 3
make dict test: #Creating dictionary
    this =  "this"
    if this == "this":
        pass
    that = "that"

LISP

func printhis(s):
	format(t,s)
printhis("Customized!")

For more see the Documentation

Languages

Share your language here

Download

Community

DiscordRedditGoogle Groups

LangTrans is licensed under MIT License

<script src="https://utteranc.es/client.js" repo="langtrans/langtrans" issue-term="pathname" label="comment" theme="github-light" crossorigin="anonymous" async> </script>