Programming Languages

1327 readers
4 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 2 years ago
MODERATORS
1
 
 

cross-posted from: https://lemmy.world/post/30361372

Hi all,

I don't know where would be the best place to post this, but I wanted some people's feedback on a DSL that I wrote for network analysis.

I am using nom for writing the lexer and parser, then using abi_stable crate for data types so that you can write plugins to the language and load them dynamically as well.

This language is made to work by loading a tree graph (network) and then call a bunch of node or network functions that work on it. There are different ways you can run functions, and use node/network attributes.

I am mostly self-taught, so it took a lot of years to get to a level where I could write something like this. I am learning a lot and having a lot of fun in the process, but I want this to develop into something that can have a practical usefulness to people. Since I am in the field of hydrology, I am making it with river networks in the mind.

To try it out, you can either download the executables for windows from the releases page, or you can compile it using cargo (for all OS; except android where GUI won't work, CLI will work in termux). I have some basic examples in the Learn By Examples section of the User Guide that you can follow.

Please let me know if you can't compile/use it as well. I have tried to make sure it has required instructions, but I could have missed something.

2
 
 

PL/I (pronounced "Programming Language 1") is a programming language that first appeared in 1964. It resembles BASIC and COBOL. This site is bare-bones and uses tables for layout (common before CSS).

However, this compiler is relatively new and still being maintained. v1.4.0 was released yesterday (it added support for array expressions), v1.0 was released in 2023, and development started in 2007.

3
 
 

image

I wanted to make a programming language that resembled magical circles. This is more like a way to write PostScript that looks like a magical circle, but I will refer to it as Mystical in this document.

Related: https://programming.dev/post/28438809

4
 
 

(I am not the author)

Seems interesting for those who do symbolic computing

5
6
 
 

ArkScript is an interpreted/compiled language since it runs on a VM. For a long time, runtime error messages looked like garbage, presenting the user with an error string like "type error: expected Number got Nil" and some internal VM info (instruction, page, and stack pointers). Then, you had to guess where the error occurred.

I have wondered for a long time how that could be improved, and I only started working on that a few weeks ago. This post is about how I added source tracking to the generated bytecode, to enhance my error messages.

7
 
 

A design that subsumes the various syntactic forms of

  • if statements/expressions
  • switch on values
  • match on patterns and pattern guards
  • if-let constructs

and scales from simple one-liners to complex pattern matches.

8
 
 

Rivulet is a programming language of flowing strands, written in semigraphic characters. A strand is not pictographic: its flow does not simulate computation. There are four kinds of strands, each with their own symbolism and grammatical rules. Together, they form glyphs, tightly-packed blocks of code whose strands execute together.

Here is a complete Fibonacci program:

   ╵──╮───╮╭─    ╵╵╭────────╮
    ╰─╯╰──╯│       ╰─╶ ╶╮╶╮╶╯
   ╰─────╮ │      ╭─────╯ ╰─────╮
         ╰─╯ ╷    ╰───       ───╯╷

   ╵╵─╮  ╭─╮     ╭──       ╵╵╰─╮  ──╮──╮
      ╰─╮│ ╰─╯ ╵╵╰─╯╶╮       ╴─╯  ╭─╯╭─╯
      ╰─╯╰─ ╰──╯╰────╯       ╭╴ ╵╶╯ ╶╯╶╮
        ╭─╮ ╭╴               │  ╰──────╯
        │ │ │                ╰─╮       ╭─╮
      │ │ ╰─╯                  │     │   │
      ╰─╯            ╷         ╰──── ╰───╯╷

   ╵╵ ╭──  ──╮  ╭─╮         ╵╰─╮
      ╰─╮  ╭─╯╭─╯ │          ╴─╯
       ╶╯╵╶╯  │ ╷╶╯          ╭─╮
     ╭─╮ ╰────╯ │   ╭─╮        │
     │ ╰────╮ ╭─╯ ╭╴│ │      ╭─╯
     ╰────╮ │ │ │ │ │ │      │
     ╭────╯ │ │ ╰─╯ │ ╷      ╰─╷
     ╰────╮ │ ╰─────╯ │
          │ ╰─────────╯╷

9
 
 

We’ve just made Marksafe even more intuitive and concise with shorthand syntax and delimiter escaping!

New Shorthand Syntax – Write cleaner markup with:
👉 [uli]item1;;item2;;item3[/uli] instead of [ul][li]item1[/li][li]item2[/li][li]item3[/li][/ul]
👉 [bq]A blockquote example[/bq] instead of [blockquote]A blockquote example[/blockquote]

Delimiter Escaping – Need to use ;;, ,,, or other special characters inside content or attributes? Just escape them with \:
👉 [a]href=https://example.com,,Click here to see \,,escaped commas[/a]

Marksafe keeps all the flexibility of HTML while staying lightweight and readable—perfect for devs who need powerful, secure, and extensible rich text formatting.

🔗 Check it out here: https://github.com/mksunny1/marksafe
💬 Docs & API: https://github.com/mksunny1/marksafe/blob/main/docs/classes/Marksafe.md
💖 Support & Contribute: https://github.com/sponsors/mksunny1

Try it out and let me know what you think!

10
 
 

Reminds me a bit of prolog with the query system

11
12
 
 

I finally found a better memory layout to store variables in ArkScript, and I got a 76% performance boost on the binary tree benchmark, and a 21% perf boost on Ackermann(3, 7) Who knew using a contiguous storage buffer could be beneficial? 🤡

I retraced all the performance improvements I applied to ArkScript through the last five years, with updated benchmarks, AND DAMN what a journey.

13
14
 
 

Target audience: Practitioners interested in programming language design and familiar with representations of errors in at least a few different languages such as error codes, checked/unchecked exceptions, tagged unions, polymorphic variants etc.

Estimated reading time: 60 to 90 mins.

15
 
 

Hello, I made a new programming language called FuncSug. Its purpose is to make GUI programming in the browser easier.

Can you tell me what you think about it?

16
 
 

Neut is a functional programming language with static memory management.

Its key features include:

  • Full λ-calculus support
  • Predictable automatic memory management
  • The absence of annotations to the type system when achieving both of the above

Neut doesn't use GCs or regions. Instead, it takes a type-directed approach to handle resources.

17
 
 

A ~1 month old post about (sort-of) real-world experience from someone whose worked on a language as a hobby for 3 years.

18
19
 
 

After three years I feel like I'm qualified to give some general advice.

It will take much longer than you expect

20
 
 

Arenas, a.k.a. regions, are everywhere in modern language implementations. One form of arenas is both super simple and surprisingly effective for compilers and compiler-like things. Maybe because of its simplicity, I haven’t seen the basic technique in many compiler courses—or anywhere else in a CS curriculum for that matter. This post is an introduction to the idea and its many virtues.

21
22
23
 
 

Background: the authors are developing a static analysis library (or perhaps framework) called Codex and publishing papers on it. This post summarizes their most recent paper, which got accepted to OOPSLA 2024. The full paper and an artifact (Docker container) are both linked, and Codex is on GitHub with a demo.

Excerpt:

One of the main challenges when analyzing C programs is the representation of the memory. The paper proposes a type system, inspired by that of C, as the basis for this abstraction. While initial versions of this type system have been proposed in VMCAI'22 and used in RTAS'21, this paper extends it significantly with new features like support for union, parameterized, and existential types. The paper shows how to combine all these features to encode many complex low-level idioms, such as flexible array members or discriminated unions using a memory tag or bit-stealing. This makes it possible to apply Codex to challenging case studies, such as the unmodified Olden benchmark, or parts of OS kernels or the Emacs Lisp runtime.

24
 
 

The language itself: https://crystal-lang.org/. Crystal is heavily inspired by Ruby but with static typing and native compilation (via LLVM). To make up for not being dynamic like Ruby, it has powerful global type inference, meaning you're almost never required to explicitly specify types. The linked "Notes on..." page gives much more details.

25
 
 

Abstract:

A computer program describes not only the basic computations to be performed on input data, but also in which order and under which conditions to perform these computations. To express this sequencing of computations, programming language provide mechanisms called control structures. Since the "goto" jumps of early programming languages, many control structures have been deployed: conditionals, loops, procedures and functions, exceptions, iterators, coroutines, continuations… After an overview of these classic control structures and their historical context, the course develops a more modern approach of control viewed as an object that programs can manipulate, enabling programmers to define their own control structures. Started in the last century by early work on continuations and the associated control operators, this approach was recently renewed through the theory of algebraic effects and its applications to user-defined effects and effect handlers in languages such as OCaml 5.

view more: next ›