8 comments

  • chrisjj 2 hours ago

    > You can read more about Lax on the official website

    "This site can’t be reached

    Check if there is a typo in lax-lang.pp.ua."

      Mavox-ID an hour ago

      The site is under repair and there will be another link, but unfortunately it is currently unavailable.

      Mavox-ID an hour ago

      [dead]

  • gh0s1pt 2 hours ago

    could you provide more info about the language? Use cases, what makes it different from others? Syntax examples and documentation?

      Mavox-ID an hour ago

      Lax has S-syntax and Lisp-like code. It can help you learn programming and write programs on Linux, even a simple calculator or shell, and much more. Lax also has over 145 commands that you can use to do anything.

      Here's an example of Hello World:

      [start [image "Hello World!"] [nl] ]

      start - Creates a command chain image - Prints text nl - Creates a line break

      You can also use just an image using \n:

      [image "Hello World!\n"]

      Here's how to work with input:

      [start [spot name [input "Enter your name: "]] [image "Hello, "] [image name] [image "!"] [nl]]

      spot - Creates a variable input - The simple input command will print Lax> and wait for the user to enter input. If it's quoted like "image," it will be the text inside the quotes.

      Here we go. We create a variable 'name' where we assign it the value of the user's input, and then use image to display what the user entered. This is basic work with input and output, as well as variables.

      And here's also a simple calculator that calculates roots, powers, and other mathematical equations:

      [start [spot op_raw [input "Select operation (+, -, , /, sqrt, expt): "]] [spot op [string->sign op_raw]]

      [spot is_unary [eq? op [string->sign "sqrt"]]]

      [spot first_raw [if is_unary [input "Enter number: "] [input "First number: "]]] [spot first_num [to-number first_raw]] [spot first_ok [and [> [string-length first_raw] 0] [number? first_num]]]

      [spot second_raw [if [not is_unary] [input "Second number: "] ""]] [spot second_num [to-number second_raw]] [spot second_ok [or is_unary [and [> [string-length second_raw] 0] [number? second_num]]]]

      [spot dispatch_table [list [cons [string->sign "+"] +] [cons [string->sign "-"] -] [cons [string->sign ""] ] [cons [string->sign "/"] /] [cons [string->sign "expt"] expt] [cons [string->sign "sqrt"] sqrt] [] ] ]

      [spot op_pair [assq op dispatch_table]]

      [spot ans [if [not first_ok] "Error: Bad first number" [if [not second_ok] "Error: Bad second number" [if [not op_pair] "Error: Unknown operation" [start [spot func [tail op_pair]]

      [if [and [eq? op [string->sign "/"]] [= second_num 0]] "Error: Division by zero" [if [and is_unary [< first_num 0]] "Error: Negative root" [if is_unary [func first_num] [func first_num second_num] ] ] ] ] ] ] ] ]

      [image first_raw] [image " "] [image op_raw] [if [not is_unary] [start [image " "] [image second_raw]] ""] [image "="] [image ans] [nl] ]

  • an hour ago
    [deleted]
  • davydm 2 hours ago

    please provide links to documentation - programming languages are for humans to be able to translate their thoughts to instructions for the computer to follow, so a human should be able to write code in it

    I see that the official site link on the release page doesn't go anywhere (https://lax-lang.pp.ua/)