off-topic

https://github.com/clojurians/community-development/blob/master/Code-of-Conduct.md Clojurians Slack Community Code of Conduct. Searchable message archives are at https://clojurians-log.clojureverse.org/
dgb23 2021-07-03T11:18:02.131500Z

A list of random thoughts: There has been much discussion about GitHub Copilot. Assessments are ranging from “Hey this is useful for boilerplate code” to “A senior programmer doesn’t want this, also GPL”. I think there is something here that is worth exploring or learning about. I think Copilot might be the wrong approach, or rather too fuzzy and hand-wavy, but I think there is a real issue that is surfacing in these discussions: What we as programmers actually want to do is communicate intent, and this might or might not be accommodated by language facilities and abstractions of our platforms. For one, I think if we need tools to write boilerplate for us, based on previously written code, then we are just not using the right tool for the job, except if the intent is to actually write boilerplate so we can see the right abstractions emerging. In expressive, dynamic languages like Clojure we have the tools to semantically compress code - avoiding boilperlate. The actual problem is not writing code, but reading and understanding it. A REPL, first class data and functions, immutable data structures, metadata and so on can help us with that. Which is fantastic! But we’re still doing a kind of low level expression based reasoning by understanding smaller things and composing smaller things to larger ones. This bottom up, expression based reasoning is paramount to really understand a given program (or parts of it). But we have nothing to guide us through. This is maybe where some form of AI could help? It doesn’t need to be the kind of ML AI that is discussed above. What comes to mind first is spec and instrumentation. We have a way of saying “This piece of lego doesn’t fit on that piece of lego, because of this assertion.” - where the pieces are not just basic types, but very expressive shapes that declare assumptions and guarantees. What we cannot say is “Which assumptions are likely to be wrong?” and “What might be a piece that is missing between these lego tiles to satisfy these guarantees?“. Say I go from A -> B -> D, there is a tool that says: Try putting in C between B and D.

nate sire 2021-07-04T18:02:39.157400Z

I just tried to install CoPilot but there is a wait list

nate sire 2021-07-04T18:03:13.157600Z

sova-soars-the-sora 2021-07-05T18:53:50.203Z

Bingo! =D

phronmophobic 2021-07-05T23:32:16.206100Z

I don't think copilot necessarily implies that the target languages/frameworks have too much boilerplate. It certainly helps with spitting out boiler plate, but it's really common to have some starter code for specific tasks (eg. requiring the right namespaces and making a place to fill in data/functionality). In many cases, I wouldn't consider that "too much" boilerplate. Basically, anything that you would copy and paste from a Readme would be convenient as an auto suggestion from your IDE. IMO, Just about every clojure library has something like that.

👍 1
🙌 1
borkdude 2021-07-03T11:25:21.131600Z

I've considered something like that for https://borkdude.github.io/re-find.web/

1
borkdude 2021-07-03T11:25:39.131800Z

But I didn't consider that worth the investment yet

dgb23 2021-07-03T11:28:07.132Z

I should have mentioned re-find.web and also clj-kondo because they popped into my head when writing this!

dgb23 2021-07-03T11:32:09.132200Z

One thing that would push it into the direction above would be a notion of composition, so it actually finds something when I say [1 2] -> [2 3]

borkdude 2021-07-03T11:33:54.132400Z

right, it should find map inc right, but I think no matter how intelligent this thing can be made, the user should get some education first to he/she can ask better questions, since you basically want to ask the question: give me the function f for 1 -> 2

2021-07-03T12:54:00.133500Z

I got a bit of a chuckle coming across a link to this StackOverflow question asking about "round brackets": https://stackoverflow.com/questions/68220522/what-do-round-brackets-mean-in-the-output-of-clojure-test-failures I've heard of square brackets and curly braces, but not those 🙂

javahippie 2021-07-03T13:02:07.135Z

To be honest, the whole bracket/parenthesis/braces is quite confusing to non-native speakers. In Germany everything is a „Klammer“ 😄

borkdude 2021-07-03T13:12:01.135200Z

in Dutch "haakje"

borkdude 2021-07-03T13:12:48.135400Z

haakjes = () accolades = {} vierkante haakjes = []

💪 1
🙂 1
dpsutton 2021-07-03T13:24:20.136400Z

I could get onboard with switch to klammer. That is a fantastic word

👍 3
borkdude 2021-07-03T13:25:28.136700Z

ok, let's do it

Thomas Moerman 2021-07-03T14:35:11.137200Z

Klammer, that's a great name for an industrial synthwave band.

💡 1
teodorlu 2021-07-03T14:46:47.138600Z

Would Github copilot be a thing if people used a concise language in the first place?

☝️ 2
1
dgb23 2021-07-03T15:19:18.142800Z

In the trivial case I agree! But it means you already know map. What if the function is provided from a lib you are not yet comfortable with? Or a composition thereof. Or what if you want to undrrstand something from the outside (debugging) rather from within its components?

borkdude 2021-07-03T15:21:35.144600Z

yep, those are interesting cases, but considering the amount of traffic/questions I get from re-find.web I didn't think such a tool would be very much used. once you get the basics of Clojure you tend to not need such a tool anymore I think

vemv 2021-07-03T15:22:02.145Z

or if each PL community self-organised in high-quality, discoverable libraries (we're kinda there... some communities more than others. IMO we're the best one in that aspect, except for some Lisp Curse in terms of effort duplication)

👍 2
seancorfield 2021-07-03T16:17:11.145200Z

I know a lot of non-programmers who refer to all of (, [, { as "brackets", and so they will sometimes qualify with "round", "square", "curly". I think it's really only programmers and maybe English majors who say "parens"/"parentheses", ("square") "brackets", and "braces"? I can see how someone unfamiliar with English and/or programming would find this pretty confusing...

👍 1
sova-soars-the-sora 2021-07-03T17:01:54.146100Z

with enough source code to train an autocomplete dataset based on comments, yes

nate sire 2021-07-03T17:11:28.146300Z

I saw CoPilot... but not sure if it can program an entire code base for you?

dgb23 2021-07-03T17:14:16.147500Z

Yes. It was pretty much an exact copy right?

dgb23 2021-07-03T17:17:42.149500Z

@borkdude you might be right! Maybe there is a subset functionality that is useful for understanding and debugging though.

nate sire 2021-07-03T17:20:28.149900Z

is it on youtube? CoPilot actually reverse engineered Quake? Or you mean it just helped assist someone in cloning the code?

nate sire 2021-07-03T17:22:15.150300Z

I thought CoPilot was just to assist in writing boilerplate? Not actually reverse engineer a program?

p-himik 2021-07-03T17:28:14.150500Z

Q3A is open source, no need to reverse engineer anything: https://github.com/id-Software/Quake-III-Arena/blob/dbe4ddb10315479fc00086f08e25d968b4b43c49/code/game/q_math.c#L552-L564

emccue 2021-07-03T17:29:42.150800Z

kinda curious about how well it would do with clojure

emccue 2021-07-03T17:29:57.151Z

my guess is not well at all given the low amount of code to train on

Juλian (he/him) 2021-07-03T18:21:02.151900Z

Copilot seems to also auto complete secrets like API-Keys

mpenet 2021-07-03T18:51:42.152100Z

It's gpl code (qrsqrt), great way to get into licensing issues