Fork me on GitHub
#off-topic
<
2022-04-25
>
emccue00:04:06

I don't think i've ever been so quickly convinced by anything as i have by https://documentation.divio.com/

💯 2
👍 1
emccue00:04:58

Thanks to @U05476190 who is the one i saw it first from, though i see in the slack history @U02N27RK69K mentioned it shortly before

💜 2
Cora (she/her)00:04:19

it was a team effort

p-himik08:04:02

Drew DeVault has announced a new systems programming language, Hare, that he and others have been working on for quite some time now: https://harelang.org/blog/announcing-hare/

👀 3
dgb2308:04:00

> Hare does not, and will not, support any proprietary operating systems.

dgb2308:04:24

I’ve been a lazy mac user for a decade now. But I’ve been thinking about switching to a more sustainable machine and Linux distro. However the above restriction strikes me as quite intense.

Asko Nōmm08:04:11

Yeah that’s one way to make sure your programming language will only be used by hardcore FOSS people who spend their days yelling about walled gardens in every Apple or Microsoft HN thread.

dgb2308:04:38

Also kind of makes the language non-free. At least in spirit. I guess you are still free to fork and extend it so it targets these OSes.

pavlosmelissinos08:04:49

A lot of people are passionate about free, open source software. Drew is not saying that they're going to put effort into making Hare incompatible with windows and Mac. They just won't put resources into supporting those operating systems. I don't see anything wrong with that.

dgb2308:04:28

Me neither - it’s just a very intense restriction for adoption IMO. It’s fine - but has to be noted.

pavlosmelissinos08:04:48

> Also kind of makes the language non-free. At least in spirit. > It does?

dgb2308:04:59

Legally, no. But in spirit there should not be any restrictions about the usage, modification etc.

dgb2308:04:26

But this is just a vague impression. I’m not a philosopher or FOSS expert.

Ben Sless09:04:07

The language is free, the author is free to not work to support platforms he does not believe in, or work to integrate and support patches which will do so. Time is limited :man-shrugging:

dgb2309:04:39

Yes, fully agreed - I didn’t think far enough before writing the above 🙂

Ben Sless09:04:11

It's a legitimate gut reaction, but as someone who would happily give Rob Zemlin a swirly he has my sympathies 😅

😂 1
Ben Sless09:04:25

I'll just cry about the algol syntax and mutability being hard

😅 3
p-himik09:04:54

> Non draft version can be found here Ah, thanks! Funny how Drew himself has shared the non-public version publicly.

chouser15:04:34

Who wants to work through Lisp in Small Pieces together? https://chouser.us/lisp2022/

👋 4
dgb2317:04:29

This is super cool. Not for me at the moment though - I’m already swamped with things I want to study rn.

dgb2317:04:16

However I saw a study group advertising itself here just some days ago. They are doing coding challenges I think (stuff like advent of code etc.) Maybe get in touch there.

chouser18:04:53

Oh, nice. I'll sure to point others at the study group, if this seems like too much of a commitment them. We've got 8 people signed up already for LiSP, so I think we'll make a go of it!

🚀 1
borkdude18:04:53

@U050BHA78 Subscribing to this thread for further announcements

💡 1
borkdude18:04:51

I've also sent you a DM on twitter

👍 1
chouser18:04:11

@U04V15CAJ I doubt you need any more practice implementing lisp interpreters, but you're welcome to join us!

🔥 1
borkdude18:04:56

Maybe I'll get an idea or two ;)

borkdude19:04:14

What wasn't clear to me: do you organize sessions or is this "drop into slack and chat about it" kind of thing?

chouser19:04:20

I think the group will be too large and/or diverse (in experience, time-zone, etc.) to have the primary progress be made via whole-group sessions. Sub-groups may want to pursue that, so we'll see how that goes. That probably doesn't clarify things much, but it's about all I've got at this point.

James Amberger20:04:13

Anyone wanna advise me on my db schema? Let’s say I have a table A with two columns, the second column’s values are 1 or 0, and the first column is a unique PK. Now I have another table B and one of the columns is foreign key to the first table, and my desired constraint is that not more than one row point to a row in A where the second column is 1. How should I express this in SQL?

dgb2320:04:33

That’s a unique constraint if I understand correctly

dgb2320:04:50

Not sure if this works but I would look if you can define PK and N as a composite foreign key and then have a unique constraint on N.

dgb2320:04:24

No that’s not enough 😕

James Amberger20:04:23

yeah. If I had to do this this instant I could always add a column to B

James Amberger20:04:52

and make sure it always has the same value as A.2, and just declare it unique

dgb2320:04:59

you don’t want 0's to be unique though

James Amberger21:04:06

so scratch that

James Amberger21:04:24

If the zeros were NULLs I think that would work, iirc how UNIQUE works with NULLs

dgb2321:04:59

You can write a constraint function and use CHECK

dgb2321:04:17

(check in your table definition)

James Amberger21:04:28

yeah that sounds good to me

dgb2321:04:56

feels convoluted though. But if your otherwise happy with your model and logic this would be the way to go probably

James Amberger21:04:57

thanks; I agree this looks suitable

Cora (she/her)21:04:05

can the second column ever flip from 1 to 0 or 0 to 1?

Cora (she/her)21:04:24

is there only one record in A where column 2 is 1?

Cora (she/her)21:04:12

in postgres "Currently, CHECK expressions cannot contain subqueries nor refer to variables other than columns of the current row"

Cora (she/her)21:04:56

apparently you can use a trigger to check more complex things though

James Amberger21:04:29

hmm, don’t wanna go to trigger land

James Amberger21:04:31

I’ll have to hammock this one for a while I guess

Cora (she/her)21:04:44

if there is only one record in A with a value of 1 then you could use a partial unique index on foreign key column of table B

Cora (she/her)21:04:02

create unique index idx_there_can_be_only_one on B(fk) where fk = 12345

Cora (she/her)21:04:27

12345 being the pk of the record in A that has a value of 1

Cora (she/her)21:04:02

all these solutions are pretty bad

James Amberger22:04:30

maybe I’m wrong but it seems like a slight tweak of this problem should be something that’s easy to obtain

James Amberger22:04:05

the tweak being never mind the 0 vs 1, but just enforce that some field on the related table be unique

James Amberger22:04:22

nah ignore that that makes no sense