<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jonas</title>
    <description>The latest articles on DEV Community by Jonas (@jgh07).</description>
    <link>https://dev.to/jgh07</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3392492%2Ffe199887-a37e-4863-a0db-d3df01523982.png</url>
      <title>DEV Community: Jonas</title>
      <link>https://dev.to/jgh07</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jgh07"/>
    <language>en</language>
    <item>
      <title>Dassie – A new programming language for .NET</title>
      <dc:creator>Jonas</dc:creator>
      <pubDate>Sun, 27 Jul 2025 21:24:06 +0000</pubDate>
      <link>https://dev.to/jgh07/dassie-a-new-programming-language-for-net-20ab</link>
      <guid>https://dev.to/jgh07/dassie-a-new-programming-language-for-net-20ab</guid>
      <description>&lt;p&gt;Over the last few months I've been working on a new programming language called &lt;strong&gt;Dassie&lt;/strong&gt; that compiles to .NET CIL. It started as a project to learn about compiler development, but it's slowly been taking shape and getting more features. It's still very early in development and doesn't have a whole lot of features yet, but you can already do some basic stuff with it.&lt;/p&gt;

&lt;p&gt;The compiler is located &lt;a href="https://github.com/loschsoftware/dc" rel="noopener noreferrer"&gt;here&lt;/a&gt;, documentation and code examples can be found &lt;a href="https://github.com/loschsoftware/dassie" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Here is "Hello World" in Dassie:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;println "Hello World!"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This uses the built-in function &lt;code&gt;println&lt;/code&gt;, but since Dassie is .NET-based, you can also use the &lt;code&gt;Console&lt;/code&gt; class:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import System

Console.WriteLine "Hello World!"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Assuming you have installed the Dassie compiler and the above code is contained in a file called &lt;code&gt;hello.ds&lt;/code&gt;, it can be compiled using the command &lt;code&gt;dc hello.ds&lt;/code&gt;, yielding a .NET assembly called &lt;code&gt;hello.dll&lt;/code&gt; as well as a native app host.&lt;/p&gt;

&lt;p&gt;The following is a short overview of the language, more thorough documentation can be found in the repo I linked above.&lt;/p&gt;

&lt;h2&gt;
  
  
  Language overview
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Single-line comment
#[
    Multi-line comment
]#
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;All Dassie code needs to be contained in a type. Like C#, Dassie also allows &lt;strong&gt;top-level&lt;/strong&gt; code in one file per project, which is automatically declared as the entry point of the program. Types are defined like this, where a &lt;strong&gt;module&lt;/strong&gt; is equivalent to a C# &lt;code&gt;static class&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;type MyType = {
    # Members...
}

module MyModule = {
    # Members...
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Variables and functions
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;x = 10
x: int = 10
var x = 10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Dassie is statically typed, but has automatic type inference for variables. Variables are &lt;strong&gt;immutable&lt;/strong&gt; by default, but can be declared as mutable using the &lt;strong&gt;var&lt;/strong&gt; modifier.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Functions&lt;/strong&gt; are defined just like variables, except that they cannot have a &lt;strong&gt;var&lt;/strong&gt; modifier and include a parameter list. Type inference is not yet supported for function parameters, only return types for now.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Add (x: int, y: int) = x + y
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The body of a function is an &lt;strong&gt;expression&lt;/strong&gt; or a &lt;strong&gt;code block&lt;/strong&gt; (which is itself just an expression), no need for a return keyword.&lt;/p&gt;

&lt;p&gt;Functions are called without parentheses, altough the arguments still need to be separated by commas.&lt;/p&gt;

&lt;h2&gt;
  
  
  Control flow
&lt;/h2&gt;

&lt;p&gt;Control flow in Dassie is done using operators instead of keywords. Also, all control flow operations are &lt;strong&gt;expressions&lt;/strong&gt;. A loop, for example, returns an array of the return values of every iteration.&lt;/p&gt;

&lt;p&gt;Conditionals and loop expressions use the &lt;code&gt;?&lt;/code&gt; and &lt;code&gt;@&lt;/code&gt; operators respectively, and also have a negated form (known as the &lt;em&gt;unless&lt;/em&gt; and &lt;em&gt;until&lt;/em&gt; expressions using the operators &lt;code&gt;!?&lt;/code&gt; and &lt;code&gt;!@&lt;/code&gt;). They can be used both in &lt;strong&gt;prefix&lt;/strong&gt; and &lt;strong&gt;postfix&lt;/strong&gt; form.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import System

age = int.Parse Console.ReadLine
Console.WriteLine ? age &amp;gt; 18 = "You are an adult!"
: = "You are a child."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Arrays and Lists
&lt;/h2&gt;

&lt;p&gt;The following example shows how to create and use arrays and lists (&lt;code&gt;List&amp;lt;T&amp;gt;&lt;/code&gt;).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;numArray = @[1, 2, 3, 4, 5]
numList = [1, 2, 3, 4, 5]

firstNum = numList::0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The language is still in active development, but I'd love you to try it out. Feel free to download and play around with the compiler!&lt;/p&gt;

</description>
      <category>dotnet</category>
      <category>programming</category>
      <category>dassie</category>
      <category>csharp</category>
    </item>
  </channel>
</rss>
