You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now new version is being developed in 'next' directory. It will replace current C++ implementation.
Dachs is a general-purpose programming language designed to be enjoyable, statically-typed and dog-friendly. Dachs is intended to be used for efficient applications and tools development, not for system programming.
Goals 🐕
Light to write (inspired by Ruby)
Strongly and statically typed
Native code efficiency
OOP
Immutability-aware
Familiar with functional features
Dog-friendly
# If 'var' is specified, the argument is copied and passed by value# then mutable. Otherwise, the argument is passed by reference then# immutable. Variable definition has the same rule as this.# Type of arguments and returned value are deduced automatically.# If you want to specify the type of argument, you can use ':'.# e.g.# func step_to(var first : float, last : float, block) : ()func step_to(var first, last, block)
for first <= last
block(first)
first += 1
endend# UFCS is implemented.# '1.step_to n' is equivalent to 'step_to(1, n)'# Dachs has a block inspired from Ruby.# do-end block is passed to the last argument of callee as lambda object.# Here, 'block' variable is captured into do-end block.func fizzbuzz(n, block)
1.step_to n do |i|
casewhen i % 15 == 0
block("fizzbuzz")
when i % 3 == 0
block("fizz")
when i % 5 == 0
block("buzz")
else
block(i)
endendendfunc main
fizzbuzz 100 do |i|
println(i)
endend# Array and tuple are available as container.# (dictionary will come.)