1
8
submitted 1 month ago* (last edited 1 month ago) by arthur@lemmy.zip to c/programming_languages@programming.dev

I think most of my comments and error messages are written in Portuguese, but this is only a prototype, so please ignore that.

Kata manages memory with per-fiber bump arenas backed by structured concurrency — no garbage collector, no borrow checker, no reference counting; escape analysis decides at compile time whether each value stays local or escapes to the caller's arena, and ; in actions distinguishes "local computation" from "value that escapes." Refined types (data (Int, > _ 0) as PositiveInt) carry logical predicates validated at compile time, participate in multiple dispatch, and can delegate interface implementations to their base type through refines — a fallback mechanism with no equivalent in Rust or Haskell. The pure/impure boundary is not a monad you thread through your code — functions (lambda) and actions (action) are separate syntactic domains with their own structural rules, enforced at compile time; where Haskell tracks purity through IO as a type-level effect, Kata makes it a property of the syntax you write.


Memory

• Kata: Per-fiber bump arenas + escape analysis; no GC, no borrow checker

• Python: Refcounting + cycle GC

• Haskell: Tracing GC

• Rust: Ownership + borrow checker


Refined types

• Kata: data (Int, > _ 0) as PositiveInt — predicates validated at compile time, participate in dispatch, refines delegates interfaces to base

• Python: Not available

• Haskell: Liquid Haskell (external plugin, not core)

• Rust: Not available


Purity

• Kata: Physical barrier: separate syntax, operators, structural rules

• Python: Not enforced

• Haskell: Monadic IO (type-level effect)

• Rust: Not enforced


Conditionals

• Kata: Pattern matching + guards (exhaustiveness enforced)

• Python: if/elif/else

• Haskell: if + pattern matching

• Rust: if + match


Backend • Kata: Cranelift JIT/AOT (native, no VM)

• Python: CPython interpreter

• Haskell: GHC (LLVM/native)

• Rust: LLVM (native)

The repo is at github.com/ArthurJ/Kata — build with cargo build, then try kata repl, kata run examples/, or kata test. I'd love feedback on the language design: what feels right, what feels wrong, what you'd do differently.

action greet (name::Text) => Unit
    echo!(+ "Hello, " (+ name "!"))

action main
    greet!("World")
    greet!("Kata")

main!()
enum BMI
    Underweight(< _ 18.5)
    Normal(<= _ 25.0)
    Overweight(<= _ 30.0)
    Obese

action main
    echo!(BMI 17.0)
    echo!(BMI 22.0)
    echo!(BMI 27.0)
    echo!(BMI 35.0)
main!()
fizzbuzz :: Int => Text
lambda x:
    both: "FizzBuzz"
    fizz: "Fizz"
    buzz: "Buzz"
    otherwise: show x
    with
        fizz := divisible x 3
        buzz := divisible x 5
        both := and fizz buzz


divisible :: Int Int => Boolean
lambda x n:
    match div x n
        Ok q: = x (* n q)
        Err _: Boolean::False


action main
    for i in [1..16]
        echo!(fizzbuzz i)


main!()
2
9

Your C code "works on Linux" until Windows silently truncates long from 8 bytes to 4. Here's every cross-platform gotcha that actually bites — types, POSIX vs WinAPI, DLL exports, and more

3
4
4
14
5
0
6
1

A minimal Node.js wrapper around ClamAV that scans any file and returns a typed Verdict Symbol:

  • Verdict.Clean
  • Verdict.Malicious
  • Verdict.ScanError

Zero runtime dependencies. No daemon. No cloud. No native bindings. Works locally via clamscan or remotely via clamd TCP socket (Docker-friendly).

npm install pompelmi

Repo: https://github.com/pompelmi/pompelmi

7
3
I relent (functional.computer)

Every year or so, I start writing a programming language. I never make it very far before giving up, or just getting bored. But I keep coming back to the underlying problems, trying again and again.

8
6
9
17
10
12

The Ergonomic, Safe and Familiar Evolution of C

C3 is a programming language that builds on the syntax and semantics of the C language, with the goal of evolving it while still retaining familiarity for C programmers.

Thanks to full ABI compatibility with C, it's possible to mix C and C3 in the same project with no effort. As a demonstration, vkQuake was compiled with a small portion of the code converted to C3 and compiled with the c3c compiler.

A simple and straightforward module system that doesn't get in the way, with defaults that makes sense.

11
11
12
14

EYG's type system builds upon a proven mathematical foundation by using row typing.

EYG programs are all independent of the machine they run on. Any interaction with the world outside your program is accomplished via an effect.

Any effect can be intercepted using a handler. This allows the response from the outside world to be replaced.

Other languages have the possiblity of closure serialisation, but EYG's runtime is designed to make them efficient.

Hot code reloading – If you change the code the behaviour will update immediatly if safe.

EYG has a prototyped strongly typed shell environment.

EYG is built to support multiple runtimes. […] In the future EYG will be available in many more places, e.g. arduino, CLI's and IPaaS. EYG makes this easy by having a carefully designed minimal AST.

Code example (from landing page):

let initial = 10
let handle = (state, message) -> !int_add(state, 1)
let render = (count) -> {
  let count = !int_to_string(count)
  !string_append("the total is ", count)
}
{render: render, handle: handle, init: initial}

GitHub Repository, Apache 2.0

13
7
14
1

cross-posted from: https://programming.dev/post/46767538

Gophers, hey. Confusing ^ with exponentiation instead of XOR in Go seems like a pretty easy mistake to make. The bug itself is simple, but it still shows up even in some well-known projects with large codebases.

How often does this happen in your code?

15
14
submitted 8 months ago* (last edited 8 months ago) by Kissaki@programming.dev to c/programming_languages@programming.dev

Uiua () is a general-purpose array-oriented programming language with a focus on simplicity, beauty, and tacit code.

Uiua lets you write code that is as short as possible while remaining readable, so you can focus on problems rather than ceremony.

The language is not yet stable, as its design space is still being explored. However, it is already quite powerful and fun to use!

Uiua uses special characters for built-in functions that remind you what they do!

⚂ # Random number
⇡8 # Range up to
⇌ 1_2_3_4 # Reverse

cross-posted from: https://programming.dev/post/46403010

Sample with fibonacci:

⍥◡+9∩1 is the fibonacci in this language


Commenter maegul writes on the Programming community post:

I tried to go through the tutorial a year or so ago.

I can’t recall when, but there’s a point at which doing something normal/trivial in an imperative language requires all sorts of weirdness in Uiua. But they try to sell it as especially logical while to me they came off as completely in a cult.

It’s this section, IIRC: https://www.uiua.org/tutorial/More%20Argument%20Manipulation#-planet-notation-

When they declare

And there you have it! A readable syntax juggling lots of values without any names!

For

×⊃(+⊙⋅⋅∘|-⊃⋅⋅∘(×⋅⊙⋅∘)) 1 2 3 4

Which, if you can’t tell, is equivalent to

f(a,b,c,x) = (a+x)(bx-c)

With arguments 1, 2, 3, 4.

I wanted to like this, and have always wanted to learn APL or J (clear influences). But I couldn’t take them seriously after that.

16
6
Fun With Dada (smallcultfollowing.com)
17
17

From the README:

What is KORE?

KORE is a self-hosting programming language that combines the best ideas from multiple paradigms:

Paradigm Inspiration KORE Implementation
Safety Rust Ownership, borrowing, no null, no data races
Syntax Python Significant whitespace, minimal ceremony
Metaprogramming Lisp Code as data, hygienic macros, DSL-friendly
Compile-Time Zig comptime execution, no separate macro language
Effects Koka/Eff Side effects tracked in the type system
Concurrency Erlang Actor model with message passing
UI/Components React/JSX Native JSX syntax, components, hot reloading
Targets Universal WASM, LLVM native, SPIR-V shaders, Rust transpilation

Example

// Define a function with effect tracking
fn factorial(n: Int) -> Int with Pure:
    match n:
        0 => 1
        _ => n * factorial(n - 1)

// Actors for concurrency
actor Counter:
    var count: Int = 0

    on Increment(n: Int):
        count = count + n

    on GetCount -> Int:
        return count

fn main():
    let result = factorial(5)
    println("5! = " + str(result))
18
6
19
4
submitted 10 months ago* (last edited 10 months ago) by greenbelt@lemy.lol to c/programming_languages@programming.dev

Basically it has hashmaps and arrays, it is untyped. Similar to lua in that regard.

20
8
Rue Language (rue-lang.dev)

Memory Safe

No garbage collector, no manual memory management. A work in progress, though.

21
3
22
3
23
2
24
2
25
3
view more: next ›

Programming Languages

1575 readers
1 users here now

Hello!

This is the current Lemmy equivalent of https://www.reddit.com/r/ProgrammingLanguages/.

The content and rules are the same here as they are over there. Taken directly from the /r/ProgrammingLanguages overview:

This community is dedicated to the theory, design and implementation of programming languages.

Be nice to each other. Flame wars and rants are not welcomed. Please also put some effort into your post.

This isn't the right place to ask questions such as "What language should I use for X", "what language should I learn", and "what's your favorite language". Such questions should be posted in /c/learn_programming or /c/programming.

This is the right place for posts like the following:

See /r/ProgrammingLanguages for specific examples

Related online communities

founded 3 years ago
MODERATORS