r/ProgrammingLanguages • • Mar 13 '26

Requesting criticism Writing A Language Spec?

Hello all,

I spent most of last week writing an informal spec for my programming language Pie.

Here's a link to the spec:

https://pielang.org/spec.html

This is my first time writing a spec on something that is somewhat big scale, and unfortunately, there aren't many resources out there. I kept going through ECMAscript's spec and the most recent C++ standard to see how they usually word stuff.

Now with a big chunk of the spec done, I thought I would request some criticism and suggestions for what I have so far.

More accurately, I'm not asking for criticism on the language design side of things, but on the wording of the spec and whether it makes sense to the average developer. Keep in mind that the spec is not meant to be formal, rather, just enough to be good-enough and deterministic enough on the important parts.

Thank you in advance!!

29 Upvotes

38 comments sorted by

View all comments

Show parent comment

2

u/Pie-Lang Mar 13 '26

This is very good feedback!!

I admit I struggle with typos. I could probably put the text through a word document to catch most of them.

Improper names do need a more robust definition. Thanks for that!

Only thing I didn't understand is your last question:

> what is the type syntax for a function on more than one variable?

Do you mean the type of a function that takes more than one parameter?

2

u/AustinVelonaut Admiran Mar 13 '26 edited Mar 13 '26

Yes. Your example given is for one parameter:

Int2Int: (Int): Int = (x: Int): Int => 1;

If you were to define an IntPair2Int function, how would the type syntax look?

IntPair2Int: (Int, Int): Int = (x: Int, y:Int): Int => x + y + 1;

or IntPair2Int: (Int) :(Int) :Int ...

or something else?

1

u/Pie-Lang Mar 13 '26

I see. That's a good point. Will fix that.

Your first intuition is correct btw:

IntPair2Int: (Int, Int): Int;

Thank you!