Jump to page: 1 2 3
Thread overview
styx, a programming languange written in D, is on the bootstrap path
Jan 14, 2021
Basile B.
Jan 14, 2021
Daniel N
Jan 15, 2021
Basile B.
Jan 15, 2021
Basile B.
Jan 15, 2021
Per Nordlöw
Jan 15, 2021
Basile B.
Jan 18, 2021
Basile B.
Jan 18, 2021
Basile B.
Jan 18, 2021
Basile B.
Jan 19, 2021
Max Haughton
Jan 19, 2021
Basile B.
Jan 16, 2022
Basile B.
Jan 16, 2022
Brian Callahan
Jan 16, 2022
Basile B.
Jan 16, 2022
Brian Callahan
Jan 18, 2021
IGotD-
Jan 18, 2021
Basile B.
Jan 16, 2022
Basile B.
January 14, 2021
This is the last[1] occasion to speak about a programming language initiatly made in D, as the bootstrap phase is very near.

I'd like to thank the D compiler developers, that let me work on DMD even if I borrow another path.

[1] : https://gitlab.com/styx-lang/styx
January 14, 2021
On Thursday, 14 January 2021 at 17:51:51 UTC, Basile B. wrote:
> This is the last[1] occasion to speak about a programming language initiatly made in D, as the bootstrap phase is very near.
>
> I'd like to thank the D compiler developers, that let me work on DMD even if I borrow another path.
>
> [1] : https://gitlab.com/styx-lang/styx

Love the design FWIW.
January 15, 2021
On Thursday, 14 January 2021 at 20:21:42 UTC, Daniel N wrote:
> On Thursday, 14 January 2021 at 17:51:51 UTC, Basile B. wrote:
>> This is the last[1] occasion to speak about a programming language initiatly made in D, as the bootstrap phase is very near.
>>
>> I'd like to thank the D compiler developers, that let me work on DMD even if I borrow another path.
>>
>> [1] : https://gitlab.com/styx-lang/styx
>
> Love the design FWIW.

Initially I wanted something like libdparse + dsymbol, i.e a clean split of the AST the semantic phase, semi-success. There's still a Symbol class but the types have been moved to the AST.

Another design idea is that I wanted to have useful visitors, i.e that always process a whole compilation unit, but that did not work well so now visitors are pretty much state-less and when a "state" is required it is stored in scopes, "like in dmd". I quote that because many times I've discovered that, in dmd, if things are done in a way and not another, it's not arbitrary. The main reason for that is that if you want to support out of order declarations and "auto" you have to drive the semantics like in dmd, declaration -> bodies -> statements -> expressions, and when you reach something that is not known you launch this chain...
January 15, 2021
On Thursday, 14 January 2021 at 17:51:51 UTC, Basile B. wrote:
> This is the last[1] occasion to speak about a programming language initiatly made in D, as the bootstrap phase is very near.

Interesting project! How did you move from D to Styx? (I assume bootstrapping means a self hosting compiler?) Did you write some scripts to translate?

I've found myself to sketch new programming languages whenever I hit things in existing languages that I find annoying over the past decade or so. I finally decided to start on a lexer for it... How long did it take you to get where you are now?
January 15, 2021
On Friday, 15 January 2021 at 09:54:59 UTC, Ola Fosheim Grøstad wrote:
> On Thursday, 14 January 2021 at 17:51:51 UTC, Basile B. wrote:
>> This is the last[1] occasion to speak about a programming language initiatly made in D, as the bootstrap phase is very near.
>
> Interesting project! How did you move from D to Styx? (I assume bootstrapping means a self hosting compiler?) Did you write some scripts to translate?

self-hosting is not started yet, maybe next month, classes are still to be implemented.
I plan to use dparse for the most part, not only to convert but also to detect non bootstrapable code or missing features. Then, feature freeze, convert, catch and fix bugs as they will appear when feading the compiler with real food.

> I've found myself to sketch new programming languages whenever I hit things in existing languages that I find annoying over the past decade or so.

This is a noble reason. Styx has no such motivations. It is simpler than D1 for example and has no killer feature, just 3 or 4 creative things are
- optional break/continue expression
- explicit overloads
- DotExpression aliases (they have been proposed to DMD this summer when I worked "under cover" as Nils.)
- pointers to member function is very different from what I have seen so far (no fat pointer)

> I finally decided to start on a lexer for it... How long did it take you to get where you are now?

The project exists since several years (2017-04-13 20:05:51) but is only actively developed since july 2020. The game changers were:
- to use LLVM instead of libfirm
- to that some part of the initial design were bad
- proper lvalue implementation
January 15, 2021
On Friday, 15 January 2021 at 19:18:09 UTC, Basile B. wrote:
> - DotExpression aliases (they have been proposed to DMD this summer when I worked "under cover" as Nils.)

Can you give examples of what a DotExpression alias is?
January 15, 2021
On Friday, 15 January 2021 at 19:18:09 UTC, Basile B. wrote:
> I plan to use dparse for the most part, not only to convert but also to detect non bootstrapable code or missing features.

Ah, smart. I've been thinking about using an existing d-parser to convert unit tests from D to my Dex syntax (experimental project). Modifying the compiler is fun, but writing unit tests is not...

> This is a noble reason. Styx has no such motivations. It is simpler than D1 for example and has no killer feature,

What made D1 attractive to many C++ programmers was that it was stripped down. Also, many language designers get tempted to add many features that are hollow, then they regret it and rip it all out again (lots of wasted effort and source code). So, being very restrictive and patient is a good thing, I believe. The truly good ideas takes time to "grow" (in ones mind).

> just 3 or 4 creative things are
> - optional break/continue expression
> - explicit overloads
> - DotExpression aliases (they have been proposed to DMD this summer when I worked "under cover" as Nils.)
> - pointers to member function is very different from what I have seen so far (no fat pointer)

"Nils" is a very scandinavian name? :-)

It will be interesting to see what your codebase looks like after moving to self hosted. I assume you will keep us up to date.

>> I finally decided to start on a lexer for it... How long did it take you to get where you are now?
>
> The project exists since several years (2017-04-13 20:05:51) but is only actively developed since july 2020. The game changers were:
> - to use LLVM instead of libfirm
> - to that some part of the initial design were bad
> - proper lvalue implementation

But that is only 6 months? Then you have come quite far if you are already going for self hosting.

I'm still rethinking my lexer. Hehe. Like, do I want to make keywords tokens or should they just be lexed as identifiers? I did the first, but think maybe the last is more flexible, so a rewrite... is coming. ;)


January 15, 2021
On Friday, 15 January 2021 at 19:25:38 UTC, Per Nordlöw wrote:
> On Friday, 15 January 2021 at 19:18:09 UTC, Basile B. wrote:
>> - DotExpression aliases (they have been proposed to DMD this summer when I worked "under cover" as Nils.)
>
> Can you give examples of what a DotExpression alias is?

They allow to pull heavily nested members, similarly as getters are sometime used and are supposed to make object composition easier. This [1] is the test file used to develop the feature.

[1] https://gitlab.com/styx-lang/styx/-/raw/51611f2d5c023c0edfe97968b543660ae2e89c26/tests/backend/dotexp_alias.sx
January 18, 2021
On Friday, 15 January 2021 at 19:40:11 UTC, Ola Fosheim Grøstad wrote:
> On Friday, 15 January 2021 at 19:18:09 UTC, Basile B. wrote:
>> I plan to use dparse for the most part, not only to convert but also to detect non bootstrapable code or missing features.
>
> Ah, smart. I've been thinking about using an existing d-parser to convert unit tests from D to my Dex syntax (experimental project). Modifying the compiler is fun, but writing unit tests is not...
>
>> This is a noble reason. Styx has no such motivations. It is simpler than D1 for example and has no killer feature,
>
> What made D1 attractive to many C++ programmers was that it was stripped down. Also, many language designers get tempted to add many features that are hollow, then they regret it and rip it all out again (lots of wasted effort and source code). So, being very restrictive and patient is a good thing, I believe. The truly good ideas takes time to "grow" (in ones mind).
>
>> just 3 or 4 creative things are
>> - optional break/continue expression
>> - explicit overloads
>> - DotExpression aliases (they have been proposed to DMD this summer when I worked "under cover" as Nils.)
>> - pointers to member function is very different from what I have seen so far (no fat pointer)
>
> "Nils" is a very scandinavian name? :-)

Yeah, in addition to my real name, I've been invovled in dmd as "Nils Lankila" and "Stian Gulpen" which are names generated using specialized services. You can choose to have a swedish name for example.



January 18, 2021
On Monday, 18 January 2021 at 17:45:16 UTC, Basile B. wrote:
> On Friday, 15 January 2021 at 19:40:11 UTC, Ola Fosheim Grøstad wrote:
>> [...]
>
> Yeah, in addition to my real name, I've been invovled in dmd as "Nils Lankila" and "Stian Gulpen" which are names generated using specialized services. You can choose to have a swedish name for example.

on the internet nobody knows you're a dog ;)
« First   ‹ Prev
1 2 3