4 ms·
First of all, thanks for taking the time. I'll try to address your questions in the same order, feel free to yell if I miss anything. 'T0' will be substituted
by sifoo 9y ago
First of all, thanks for taking the time. I'll try to address your questions in the same order, feel free to yell if I miss anything.
'T0' will be substituted for the type of the first parameter (indexing starts from 0) on evaluation, it's the most straight forward way of adding the constraint that two parameters need to be the same type without specifying which type. I should make the example clearer by specifying a less concrete type for x.
Nope, no way right now. I realize it would be nice to have in the REPL but functions use their index in the list of implementations to implement upcall which means I have to figure out another way to do that fast for that to happen.
The reason some fields have plural functions as well is because they have dual semantics. You have both the total number of days and the specific day of month, for example. The year only has one meaning. I guess you could alias 'years' to 'year', but then someone is going to wonder why it's there instead. There's some more material on the reasoning behind dates/times in /devlog.
You pretty much nailed the heuristics I've been using to drive the design. It's been cooking for quite some time but I only started working on the implementation 3 weeks ago or so.
It's slowly getting to the point where it's possible to write more interesting code. I'm waiting for a couple of bigger pieces to fall in to place first, structs are up next.
The C in the name is derived from the host language, which would make that SIX-el.
- davegauer 9y agoParameter types: Okay, I'm closer to understanding: "T0" means "Type number 0". But I'm still confused by the example: func: baz(x y Int z T0) $x + $y + $z; z is the same type as the 0th type. I get that now. But what's confusing me is that it looks as if x's type is unspecified. The 'Int' here belongs to y, right? I'm sure I'll slap my forehead when it's explained to me... Dates: I see what you mean about there not being a "year of the _" semantically. But when formatting a date, I think of it as "year-month-day", not "years-month-day". You've made excellent progress in 3 weeks! Keep it up!
- sifoo 9y agoOk, now I get where you're going. x and y share the same type, just like 'int x, y' in C. That's what happens when you try to explain two concepts at the same time, my mistake. You have a point with the years, I'll add an alias for now. That is the goal; I'm kind of depending on people chipping in to be able to keep up the pace though, I had a nice runway set up for xmas but now the pressure is on again.
- davegauer 9y agoParam types: Ah, of course. I had a vague suspicion that was what was going on. But my brain was overloaded. Yeah, one concept per example is ideal. :-) 'Year' alias: excellent! That's one of those "look and feel" things that can make the transition to a new language so much smoother. I was going to add something about "now comes the hard part after the initial flurry of activity: steadily growing the language without losing the passion." But I didn't want to end on a downer. I'm truly impressed with what you have so far.
- sifoo 9y agoAgreed, it needs momentum to keep going and that's where I could use some help right now. But it also becomes less of a struggle since I don't have to constantly invent the ground I'm walking on, and since it's now getting to the point where interesting programs are becoming possible. As an example, adding symbol support (https://github.com/basic-gongfu/cixl#symbols https://github.com/basic-gongfu/cixl#symbols) took about 30mins.