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.
I just tried to install CoPilot but there is a wait list
Bingo! =D
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.
I've considered something like that for https://borkdude.github.io/re-find.web/
But I didn't consider that worth the investment yet
I should have mentioned re-find.web and also clj-kondo because they popped into my head when writing this!
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]
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
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 🙂
To be honest, the whole bracket/parenthesis/braces is quite confusing to non-native speakers. In Germany everything is a „Klammer“ 😄
in Dutch "haakje"
haakjes = () accolades = {} vierkante haakjes = []
I could get onboard with switch to klammer. That is a fantastic word
ok, let's do it
Klammer, that's a great name for an industrial synthwave band.
Would Github copilot be a thing if people used a concise language in the first place?
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?
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
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)
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...
with enough source code to train an autocomplete dataset based on comments, yes
I saw CoPilot... but not sure if it can program an entire code base for you?
Yes. It was pretty much an exact copy right?
@borkdude you might be right! Maybe there is a subset functionality that is useful for understanding and debugging though.
is it on youtube? CoPilot actually reverse engineered Quake? Or you mean it just helped assist someone in cloning the code?
I thought CoPilot was just to assist in writing boilerplate? Not actually reverse engineer a program?
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
kinda curious about how well it would do with clojure
my guess is not well at all given the low amount of code to train on
Copilot seems to also auto complete secrets like API-Keys
It's gpl code (qrsqrt), great way to get into licensing issues