Programming Languages

1418 readers
3 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
 
 

The article ArkScript September 2025 update is the last one I wrote, covering all the changes I made on the language this summer.

Finally, I have released this huge set of breaking changes that makes ArkScript v4, and I'm pretty proud of it. I won't stop working on the language, however it's a big milestone for me: I've reach a point where the language is more than decent to use every day, errors are correctly reported, and the documentation is pretty good too (I might be biaised, I wrote it myself so I don't have an objective point of view): https://arkscript-lang.dev/

I've also written an article comparing ArkScript with other Lisps (which is still a WIP but is already good enough) for the curious ones here.

2
3
 
 

I think this is a decently interesting consideration in programming language design. When you have things flowing from left to right, not only do you get better autocomplete as per the article, but it's probably also easier to read, and very likely easier to edit (your cursor can simply go in its natural direction instead of having to jump around).

Though this comment on Lobsters points out that left-to-right code under one way of thinking is not necessarily left-to-right code if you approach it with a different way of thinking.

4
 
 

Explores how the Lean programming language handles 2 + 2 = 4, which other programming languages collapse into a bool, but Lean considers a Proposition, and requires Proof.

How does provably correct programming look? This article seems to give a good introduction and example.

5
 
 

Pike is a dynamic programming language with a syntax similar to Java and C. It is simple to learn, does not require long compilation passes and has powerful built-in data types allowing simple and really fast data manipulation.

int getDex()
{
  int oldDex = Dex;
  Dex = 0;
  return oldDex;
}

private void
show_user(int|string id, void|string full_name)
{
  write("Id: " + id + "\n");
  if (full_name)
    write("Full name: " + full_name + "\n");
}
6
 
 

The Go 1.18 release introduced generics and with that a number of new features, including type parameters, type constraints, and new concepts such as type sets. It also introduced the notion of a core type. While the former provide concrete new functionality, a core type is an abstract construct that was introduced for expediency and to simplify dealing with generic operands (operands whose types are type parameters). In the Go compiler, code that in the past relied on the underlying type of an operand, now instead had to call a function computing the operand’s core type. In the language spec, in many places we just needed to replace “underlying type” with “core type”. What’s not to like?

Quite a few things, as it turns out! To understand how we got here, it’s useful to briefly revisit how type parameters and type constraints work.

For the Go 1.25 release (August 2025) we decided to remove the notion of core types from the language spec in favor of explicit (and equivalent!) prose where needed. This has multiple benefits: …

7
8
 
 

Seed7 is a general purpose programming language designed by Thomas Mertes. It is a higher level language compared to Ada, C/C++ and Java. The Seed7 interpreter and the example programs are open-source software. There is also an open-source Seed7 compiler. The compiler translates Seed7 programs to C programs which are subsequently compiled to machine code.

In Seed7 new statements and operators can be declared easily. Functions with type results and type parameters are more elegant than a template or generics concept. Object orientation is used where it brings advantages and not in places where other solutions are more obvious. Seed7 contains several concepts from Pascal, Ada, C, C++ and Java.


The author posted on Reddit; quoting in part:

Seed7 is based on ideas from my diploma and doctoral theses about an extensible programming language (1984 and 1986). In 1989 development began on an interpreter and in 2005 the project was released as open source. Since then it is improved on a regular basis.

Seed7 is about readability, portability, performance and memory safety. There is an automatic memory management, but there is no garbage collection process, that interrupts normal processing. The templates and generics of Seed7 don't need special syntax. They are just normal functions, which are executed at compile-time.

Seed7 is an extensible programming language. The syntax and semantics of statements (and abstract data types, etc.) is defined in libraries. The whole language is defined in the library "seed7_05.s7i". You can extend the language syntactically and semantically (introduce new loops, etc.). In other languages the syntax and semantics of the language is hard-coded in the compiler.

Seed7 checks for integer overflow. You either get the correct result or an OVERFLOW_ERROR is raised. Unlike many JVM based languages Seed7 compiles to machine code ahead of time (GRAAL works ahead of time but it struggles with reflection). Unlike many systems languages (except Rust) Seed7 is a memory safe language.

Some programs written in Seed7 are:

  • make7: a make utility.
  • bas7: a BASIC interpreter.
  • pv7: a Picture Viewer for BMP, GIF, ICO, JPEG, PBM, PGM, PNG, PPM and TIFF files.
  • tar7: a tar archiving utility.
  • ftp7: an FTP Internet file transfer program.
  • comanche: a simple web server for static HTML pages and CGI programs.

Code Example

# Print a Fahrenheit-Celsius table with floating point numbers.

$ include "seed7_05.s7i";  # This must be included first.
  include "float.s7i";     # Subsequent includes do not need a $.

const proc: main is func
  local
    const integer: lower is 0;
    const integer: upper is 300;
    const integer: increment is 20;
    var integer: fahr is 0;
    var float: celsius is 0.0;
  begin
    for fahr range lower to upper step increment do
      celsius := float(5 * (fahr - 32)) / 9.0;
      writeln(fahr lpad 3 <& " " <& celsius digits 2 lpad 6);
    end for;
  end func;
9
 
 

Lean is a theorem prover and programming language that enables correct, maintainable, and formally verified code

/-- A prime is a number larger than 1 with no trivial divisors -/
def IsPrime (n : Nat) := 1 < n ∧ ∀ k, 1 < k → k < n → ¬ k ∣ n
-- 'Grind' efficiently manages complex pattern matching and
-- case analysis beyond standard tactics.
example (x : Nat) : 0 < match x with
  | 0   => 1
  | n+1 => x + n := by
  grind
-- Automatically solves systems of linear inequalities.
example (x y : Int) :
    27 ≤ 11*x + 13*y → 11*x + 13*y ≤ 45
    → -10 ≤ 7*x - 9*y → 7*x - 9*y > 4 := by
  grind

Does anyone have experience with Lean? Can it be useful for implementing algorithms or logic beyond mathematical proofs, for software libs?

10
11
 
 

Hare’s boringness is a feature, not a bug. Our goal is not to make programming exciting again, but to make it easy to write simple, obvious programs which are optimized for reliability and longevity. An exciting programming language cannot meet that goal as effectively as Hare does. We have instead sought out the smallest and simplest language design which accommodates these goals. Because we have relatively few features, Hare programs tend to converge upon the single obvious way of solving their problems with the tools at their disposal.

12
6
submitted 2 months ago* (last edited 2 months ago) by MITM0@lemmy.world to c/programming_languages@programming.dev
 
 

I am quite nervous while asking this question, but let's say one wants to create a language.

What materials & tools one could use to get started on this path of madness ??

EDIT: I wanted to create an alternative to Javascript😂 with a syntax similar to Bash

13
14
 
 

Examples from the README

example 1

[
  { "let": { "name": "JSON", "times": 3 } },
  {
    "for": {
      "var": "i",
      "from": 1,
      "to": "times",
      "do": [
        { "print": { "add": ["Hello ", "name"] } }
      ]
    }
  }
]

example 2

[
  { "import": "system.jpl" },
  { "print": { "call": { "now": [] } } },
  { "print": { "call": { "osName": [] } } },
  { "print": { "call": { "cpuCount": [] } } },
  { "let": { "a": 9, "b": 4, "name": "JPL" } },
  { "print": { "add": ["\"a + b = \"", { "add": ["a", "b"] }] } },
  { "print": { "mul": ["a", "b"] } },
  { "print": { "div": ["a", "b"] } },
  { "print": { "mod": ["a", "b"] } },
  { "print": { "&": [6, 3] } },
  { "print": { "||": [false, true] } },
  { "print": { "gt": ["a", "b"] } },
  { "def": { "sq": { "params": ["x"], "body": [{ "return": { "mul": ["x", "x"] } }] } } },
  { "print": { "call": { "sq": [5] } } },
  { "def": { "greet": { "params": ["who"], "body": [{ "return": { "add": ["\"Hi, \"", "who"] } }] } } },
  { "print": { "call": { "greet": ["\"JSON Fan\""] } } },
  { "if": { "cond": { "<": ["b", "a"] }, "then": { "print": "\"b < a 👍\"" }, "else": { "print": "\"b >= a 🤔\"" } } },
  { "for": { "var": "i", "from": 1, "to": 3, "step": 1, "do": [ { "print": { "call": { "sq": ["i"] } } } ] } },
  { "print": "\"All features in one! 🎉\"" }
]

example 3

[
// 🚀 Welcome to JPL — JSON Programming Language!

// Import system utilities for fun stuff
{ "import": "system.jpl" },

// Print system info
{ "print": { "call": { "now": [] } } },
{ "print": { "call": { "osName": [] } } },
{ "print": { "call": { "cpuCount": [] } } },

// Define a math function to square a number
{
  "def": {
    "square": {
      "params": ["x"],
      "body": [
        { "return": { "mul": ["x", "x"] } }
      ]
    }
  }
},

// Greet a user
{
  "def": {
    "greet": {
      "params": ["name"],
      "body": [
        { "return": { "add": ["Hello, ", "name"] } }
      ]
    }
  }
},

// Declare variables
{ "let": { "a": 7, "user": "Kapil" } },

// Use greet function and print
{ "print": { "call": { "greet": ["user"] } } },

// Conditional message
{
  "if": {
    "cond": { ">": ["a", 5] },
    "then": { "print": "a is greater than 5" },
    "else": { "print": "a is 5 or less" }
  }
},

// Loop with break and continue
{
  "for": {
    "var": "i",
    "from": 1,
    "to": 10,
    "step": 1,
    "do": [
      { "if": { "cond": { "eq": ["i", 3] }, "then": { "continue": true } } },
      { "if": { "cond": { "gt": ["i", 7] }, "then": { "break": true } } },
      { "print": { "call": { "square": ["i"] } } }
    ]
  }
},

// Fun ending message
{ "print": "🎉 Done with curly braces and JSON fun!" }
]

15
16
17
18
 
 

(I'm not the author or affiliated with the project)

As someone who does arduino work, and occasionally feels the need to just slap something together with dynamic arrays, hashmaps, etc, this seems like a really nice language.

19
20
21
 
 

You can only use shell in Makefiles, right? Wrong! Here's how to use python or javascript or sql or whatever in Makefiles! (please don't do this)

22
 
 

A small scripting language.

  • Dino aims to look like C language
  • High-Level scripting object-oriented language:
    • Multi-precision integers
    • Heterogeneous extensible arrays, array slices
    • Associative tables with possibility to delete elements
    • Powerful and safe class composition operation for (multiple) inheritance and traits description
    • First class functions, classes, and fibers with closures, anonymous functions, classes, fibers
    • Exception handling
    • Concurrency
    • Pattern matching
    • Unicode 8 support

Developed ~32 years ago and revised a few times, last major revision ~9 years ago.

23
 
 

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.

24
2
Iron Spring PL/I Compiler (www.iron-spring.com)
submitted 3 months ago* (last edited 3 months ago) by armchair_progamer@programming.dev to c/programming_languages@programming.dev
 
 

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.

25
 
 

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

view more: next ›