This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-07-03
Channels
- # aws (3)
- # babashka (46)
- # bangalore-clj (2)
- # beginners (89)
- # cider (1)
- # clojure (57)
- # clojurescript (4)
- # conjure (6)
- # duct (3)
- # fulcro (2)
- # graalvm-mobile (41)
- # introduce-yourself (1)
- # lsp (12)
- # malli (11)
- # off-topic (37)
- # pathom (3)
- # pedestal (6)
- # podcasts-discuss (5)
- # polylith (17)
- # releases (2)
- # sci (2)
- # shadow-cljs (8)
- # specter (1)
- # tools-deps (10)
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 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
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
Did you see Co-Pilot auto complete the Quake source code including magic floating point number 0xBwhatever by John Carmack?
@U04V15CAJ 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
Copilot seems to also auto complete secrets like API-Keys
video of the autocomplete ^.^ https://twitter.com/mitsuhiko/status/1410886329924194309
Is it just me or does copilot imply that there is too much boilerplate in many mainstream languages/frameworks?
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.
@U3JH98J4R A lot of Clojure code is compact, custom, DSL... I think Clojure would be one of the least affected languages. I see CoPilot applying more to boilerplate in frameworks and a language like Go.
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“ 😄
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...
Would Github copilot be a thing if people used a concise language in the first place?
with enough source code to train an autocomplete dataset based on comments, yes
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)
Did you see Co-Pilot auto complete the Quake source code including magic floating point number 0xBwhatever by John Carmack?
video of the autocomplete ^.^ https://twitter.com/mitsuhiko/status/1410886329924194309
Is it just me or does copilot imply that there is too much boilerplate in many mainstream languages/frameworks?