add groovy

This commit is contained in:
Ty Dunn 2023-11-07 12:50:30 -08:00
parent d759f593d4
commit 5fa51fe9be
2 changed files with 50 additions and 1 deletions

View file

@ -0,0 +1,48 @@
# Groovy
Groovy is the #26 most popular language according to the [2023 Stack Overflow Developer Survey](https://survey.stackoverflow.co/2023/#section-most-popular-technologies-programming-scripting-and-markup-languages).
## Benchmarks
❌ Groovy is not one of the 19 languages in the [MultiPL-E benchmark](https://blog.continue.dev/an-introduction-to-code-llm-benchmarks-for-software-engineers/#:~:text=couple%20notable%20mentions-,4.%20MultiPL%2DE,-Creator%3A%20Northeastern)
❌ Groovy is not one of the 16 languages in the [BabelCode / TP3 benchmark](https://blog.continue.dev/an-introduction-to-code-llm-benchmarks-for-software-engineers/#:~:text=amazon%2Dscience/mxeval-,12.%20BabelCode%20/%20TP3,-Creator%3A%20Google)
❌ Groovy is not one of the 13 languages in the [MBXP / Multilingual HumanEval benchmark](https://blog.continue.dev/an-introduction-to-code-llm-benchmarks-for-software-engineers/#:~:text=11.%20MBXP%20/%20Multilingual%20HumanEval)
❌ Groovy is not one of the 5 languages in the [HumanEval-X benchmark](https://blog.continue.dev/an-introduction-to-code-llm-benchmarks-for-software-engineers/#:~:text=Some%20multilingual%C2%A0benchmarks-,10.%20HumanEval%2DX,-Creator%3A%20Tsinghua)
## Datasets
✅ Groovy is included in [The Stack dataset](https://arxiv.org/abs/2211.15533)
❌ Groovy is not included in the [CodeParrot dataset](https://huggingface.co/datasets/codeparrot/github-code)
❌ Groovy is not included in the [AlphaCode dataset](https://arxiv.org/abs/2203.07814)
❌ Groovy is not included in the [CodeGen dataset](https://arxiv.org/abs/2203.13474)
❌ Groovy is not included in the [PolyCoder dataset](https://arxiv.org/abs/2202.13169)
## Stack Overflow & GitHub presence
Groovy has 30,014 [tagged questions on Stack Overflow](https://stackoverflow.com/tags)
Groovy projects have had 132,381 [PRs on GitHub since 2014](https://madnight.github.io/githut/#/pull_requests/2023/3)
Groovy projects have had 108,265 [issues on GitHub since 2014](https://madnight.github.io/githut/#/issues/2023/3)
Groovy projects have had 431,291 [pushes on GitHub since 2014](https://madnight.github.io/githut/#/pushes/2023/3)
Groovy projects have had 140,122 [stars on GitHub since 2014](https://madnight.github.io/githut/#/stars/2023/3)
## Anecdotes from developers
[Figaf](https://figaf.com/chatgpt-groovy-code-help-for-sap-cloud-integration/)
> And that it was possible to use the code created by the tool to generate some code that could be used to start your programming. This could save quite a bit of time for developers to use this as a starting point, and you don’t need to have a large experience to start coding in UDFs in Groovy. It is also interesting that it has much knowledge about what is going on in an SAP universe, I would have thought it was more difficult to get data about it.
[u/West_Performance_129](https://www.reddit.com/r/groovy/comments/16kuh6s/comment/k1i0lqn/)
> Groovy is a great language with a ton of utility, and can scale like crazy! Write code as dynamic as you want, and choose to refactor into a more type-safe manner later. It's totally worth learning and having it in your toolkit. I program in it every day for many projects. All Java (99.9%) is also valid Groovy, so it's almost impossible not to understand and work with any Java code base you may come across once you get familiar with Groovy. ChatGPT and Github Co-pilot also write excellent Groovy code, which can aid you in learning, and just programming with it in general. It's still actively maintained, too! It's not going away an time soon.
[Jamon Holmgren](https://shift.infinite.red/getting-the-most-from-github-copilot-8f7b32014748)
> When I was building react-native-colo-loco, I had to write a Gradle script, which is written in Groovy. I know a little Groovy, but not much. So I focused on writing precise, accurate comments, and let Copilot suggest lines of code. I could then lean on my development experience to pick up on patterns and syntax, and go from there.

View file

@ -10,4 +10,5 @@ Objective-C,N/A,N/A,N/A,N/A,2.31%,31,"292,409","263,146","1,172,307","397,275","
Elixir,N/A,N/A,N/A,N/A,2.32%,30,"9,510","113,018","255,430","65,166","210,145",Unspecified,0,0,0,0,27.1k,https://www.reddit.com/r/elixir/,"One day, I needed to implement a priority queue with amortized O(log n) decrease-key operation in Elixir, but I didn't know how, so I consulted Monica (which interfaces GPT-3, I think), and it gave me the code of a whole Elixir module that is absolutely wrong. It was a binary heap implemented using a single list as if it's a mutable array. Furthermore, it won't even compile! I tried to correct the ""mistake"" GPT made, so I told it more about Elixir, about immutability, about lists in Elixir. I even tried to ""inspire"" GPT to write other kinds of heaps, like binomial heap and pairing heap, but GPT is so stubborn (though very polite) that it keeps giving me almost the same code over and over again. At last I gave up on GPT and turned to StackOverflow, and just a few words enlightened me (FYI, it's two heaps, one for insertion, one for deletion, and when the top nodes in both heaps have the same key, cancel them out). My conclusion is: AI is useless in some domains when it doesn't have enough learning material in those domains.",u/a3th3rus,https://www.reddit.com/r/elixir/comments/16vrhr6/comment/k2xel5z/?utm_source=share&utm_medium=web2x&context=3,"Using ChatGPT when programming with Elixir can bring several advantages. One of the most significant advantages is that it can provide quick and accurate responses to various programming queries, including syntax and documentation. This can help programmers save time and improve their productivity. Additionally, ChatGPT can offer personalised and adaptive learning experiences based on individual programmers’ skill levels and preferences. This can help programmers learn Elixir more efficiently and effectively.",u/erlangsolutions,https://www.reddit.com/r/elixir/comments/13xeh8w/how_chatgpt_improved_my_elixir_code_some_hacks/,"The question is: how much boilerplate code do you really write? Elixir compared to other languages has little to none boilerplate, and for moments such as phoenix things, there are configurable generators. I wouldn’t want an AI incapable of problem solving to generate complex code for me, because as tempting as it seems, the productivity decreases a lot if we talk about refactoring generated code compared to creating your own new code.",D4no0,https://elixirforum.com/t/get-ai-code-generation-tools-to-create-correct-elixir-code-or-else/53931/2
Perl,✅,N/A,✅,N/A,2.46%,29,"67,938","125,129","634,214","117,426","188,697",5.5,4.7,0,0,0,16.4k,https://www.reddit.com/r/perl/,"There are a few problems with this, and I noticed the exact same thing with the GitHub Copilot. It's barfing out examples it was trained on with no idea about what they do, whether they work, and if they are current. Transaction objects no longer have a success method. This was deprecated for a long time ago and finally removed in version 9. The error method returns a single value. Minor problem, but still cruft that shouldn't be there. Call json on the response to get the data structure rather than doing this yourself. Even then, using JSON directly, while fine, skips over the Mojo::JSON::decode_json. It's a bit of a pain in the butt, but work hard to use the same parser everywhere in an application since they tend to have slight differences (say, like how they represent null, true, or false). Somewhere along the line, ChatGPT saw this code or something very similar. It then returns it to you with no intelligence about what it is doing or what it should do. It's very likely that the source ChatGPT saw is not only old, but also unsophisticated. You're likely just cargo-culting off StackOverflow with extra steps. But, this also isn't the way you probably want to write code. You don't want to return the token really, You want to add that to the user-agent so it provides it in every request without additional code from you. I have plenty of examples in Mojo Web Clients. That's another problem with the source material for these sorts of things: it's training itself off public data, but often our examples are mere demonstrations of ideas rather than advice on reliable software engineering (since we aren't going to write a book for every question someone asks).",u/briandfoy,https://www.reddit.com/r/perl/comments/10j0k00/comment/j5ki948,"""Somewhere along the line, ChatGPT saw this code or something very similar. It then returns it to you with no intelligence about what it is doing or what it should do."" IMO, this is quite irrelevant, because you must understand that whatever output - be it code, poems or whatever - from an AI-assisted service is not perfect. The main point is: it helps. And that's its main selling point today, because that's how StackOverflow also works: sometimes it's perfect, but most of the times it just helps, maybe because you have addressed the wrong audience, didn't word your question/problem correctly or otherwise. With ChatGPT you get an instant reply, and you can ask it to refine its reply. Instantly. Rinse and repeat. So if it use StackOverflow data (which I assume it does) it's already better in the sense that it's instant and filters out noise, especially personal attacks, or otherwise replies that intimidates the person asking the questions. ""It then returns it to you with no intelligence about what it is doing or what it should do."" Let's be honest, we have all been there and/or we have had colleagues who fits that description. :)",u/nobono,https://www.reddit.com/r/perl/comments/10j0k00/comment/j5l9s1c/,"You mentioned being new to perl and programming. Personally, I think ChatGPT is a great resource for these types of question. I asked it your question and copied the function from csv2fasta.pl",u/its_a_gibibyte,https://www.reddit.com/r/perl/comments/14capfv/comment/jol2a4b
Scala,✅,N/A,✅,N/A,2.77%,28,"111,969","605,988","1,508,526","271,184","540,327",14.87,3.87,4.1,0,1.8,51.3k,https://www.reddit.com/r/scala/,"Today I decided to test it by asking how one would use Scala 3 macros to get the types of the inputs and outputs of a method. It had some decent suggestions to do that for someone that is new to macros, but a lot of its answer was false, suggesting people use something called QuotesContext, not recognizing properly what extension methods are available for the Symbol type, and worst of all, trying to splice Type values into an Expr. If they can manage to get chatgpt to actually tell the truth consistently (like saying ""I don't know how to do that"" rather than just lying) I think it will be a nice resource for discovering how to do stuff you don't currently know how to do. Sadly, it's still got a nasty habit of making stuff up.",u/markehammons,https://www.reddit.com/r/scala/comments/124ocqh/scala_and_chatgpt/,"Well...this is a very hold thread but I'm using the latest copilot for scala available today of this post. I mostly use the ZIO framework. I was skeptical at first but I'm finding the suggestions get smart quickly and it is generating a lot of code fragments pretty well. I'm not claiming I can live without it, but as of today, I'm thinking it works pretty well for my scenarios. I could easily see not wanting to code without in the near future. I think using a framework like ZIO makes it easier to generate code fragments because the ZIO framework has a fairly predictable surface area, but that's just a guess.",u/agilesteel,https://www.reddit.com/r/scala/comments/ovoc8n/github_copilot_for_scala_does_it_work/,I wanted to start a new Scala project based on Clean Architecture aka dependency inversion. So I asked for a basic example to demo the principles. There was a lot of pretty code but ultimately it had no idea what this was about. The code was bs.,u/k1v1uq,https://www.reddit.com/r/ChatGPTCoding/comments/zpunkt/comment/j25ftsr/?utm_source=share&utm_medium=web2x&context=3
Delphi,N/A,N/A,N/A,N/A,3.23%,27,"51,475",310,552,0,0,0,0,0,0,0,3.8k,reddit.com/r/delphi,PSA: GitHub Copilot works with Delphi,u/EasywayScissors,https://www.reddit.com/r/delphi/comments/wnhk9x/psa_github_copilot_works_with_delphi/?utm_source=share&utm_medium=web2x&context=3,"As you can see, it is possible to use an AI for simple pieces of code to create basic Delphi code quickly. We can now go one step further and implement this in Delphi itself.",Marco Geuze,https://gdksoftware.com/knowledgebase/delphi-and-chatgpt,"I asked a series of Pascal programming questions to an AI chatbot system while testing its abilities, and the following page is a record of its responses.",u/sysrpl,https://www.reddit.com/r/delphi/comments/1006ybh/programming_pascal_using_an_ai_chatbot/?utm_source=share&utm_medium=web2x&context=3
Delphi,N/A,N/A,N/A,N/A,3.23%,27,"51,475",310,552,0,0,0,0,0,0,0,3.8k,reddit.com/r/delphi,PSA: GitHub Copilot works with Delphi,u/EasywayScissors,https://www.reddit.com/r/delphi/comments/wnhk9x/psa_github_copilot_works_with_delphi/?utm_source=share&utm_medium=web2x&context=3,"As you can see, it is possible to use an AI for simple pieces of code to create basic Delphi code quickly. We can now go one step further and implement this in Delphi itself.",Marco Geuze,https://gdksoftware.com/knowledgebase/delphi-and-chatgpt,"I asked a series of Pascal programming questions to an AI chatbot system while testing its abilities, and the following page is a record of its responses.",u/sysrpl,https://www.reddit.com/r/delphi/comments/1006ybh/programming_pascal_using_an_ai_chatbot/?utm_source=share&utm_medium=web2x&context=3
Groovy,N/A,N/A,N/A,N/A,3.40%,26,"30,014","132,381","431,291","108,265","140,122",Unspecified,0,0,0,0,3.0k,https://www.reddit.com/r/groovy/,"And that it was possible to use the code created by the tool to generate some code that could be used to start your programming. This could save quite a bit of time for developers to use this as a starting point, and you don’t need to have a large experience to start coding in UDFs in Groovy. It is also interesting that it has much knowledge about what is going on in an SAP universe, I would have thought it was more difficult to get data about it.",Figaf,https://figaf.com/chatgpt-groovy-code-help-for-sap-cloud-integration/,"Groovy is a great language with a ton of utility, and can scale like crazy! Write code as dynamic as you want, and choose to refactor into a more type-safe manner later. It's totally worth learning and having it in your toolkit. I program in it every day for many projects. All Java (99.9%) is also valid Groovy, so it's almost impossible not to understand and work with any Java code base you may come across once you get familiar with Groovy. ChatGPT and Github Co-pilot also write excellent Groovy code, which can aid you in learning, and just programming with it in general. It's still actively maintained, too! It's not going away an time soon.",u/West_Performance_129,https://www.reddit.com/r/groovy/comments/16kuh6s/comment/k1i0lqn/,"When I was building react-native-colo-loco, I had to write a Gradle script, which is written in Groovy. I know a little Groovy, but not much. So I focused on writing precise, accurate comments, and let Copilot suggest lines of code. I could then lean on my development experience to pick up on patterns and syntax, and go from there.",Jamon Holmgren,https://shift.infinite.red/getting-the-most-from-github-copilot-8f7b32014748
1 language multiple babel mbxp humaneval_x so_2023_language_percent so_2023_language_rank so_tags github_prs github_pushes github_issues github_stars stack_gb codeparrot_gb alphacode_gb codegen_gb polycoder_gb subreddit_members subreddit_url anecdote_1_content anecdote_1_author anecdote_1_url anecdote_2_content anecdote_2_author anecdote_2_url anecdote_3_content anecdote_3_author anecdote_3_url
10 Elixir N/A N/A N/A N/A 2.32% 30 9,510 113,018 255,430 65,166 210,145 Unspecified 0 0 0 0 27.1k https://www.reddit.com/r/elixir/ One day, I needed to implement a priority queue with amortized O(log n) decrease-key operation in Elixir, but I didn't know how, so I consulted Monica (which interfaces GPT-3, I think), and it gave me the code of a whole Elixir module that is absolutely wrong. It was a binary heap implemented using a single list as if it's a mutable array. Furthermore, it won't even compile! I tried to correct the "mistake" GPT made, so I told it more about Elixir, about immutability, about lists in Elixir. I even tried to "inspire" GPT to write other kinds of heaps, like binomial heap and pairing heap, but GPT is so stubborn (though very polite) that it keeps giving me almost the same code over and over again. At last I gave up on GPT and turned to StackOverflow, and just a few words enlightened me (FYI, it's two heaps, one for insertion, one for deletion, and when the top nodes in both heaps have the same key, cancel them out). My conclusion is: AI is useless in some domains when it doesn't have enough learning material in those domains. u/a3th3rus https://www.reddit.com/r/elixir/comments/16vrhr6/comment/k2xel5z/?utm_source=share&utm_medium=web2x&context=3 Using ChatGPT when programming with Elixir can bring several advantages. One of the most significant advantages is that it can provide quick and accurate responses to various programming queries, including syntax and documentation. This can help programmers save time and improve their productivity. Additionally, ChatGPT can offer personalised and adaptive learning experiences based on individual programmers’ skill levels and preferences. This can help programmers learn Elixir more efficiently and effectively. u/erlangsolutions https://www.reddit.com/r/elixir/comments/13xeh8w/how_chatgpt_improved_my_elixir_code_some_hacks/ The question is: how much boilerplate code do you really write? Elixir compared to other languages has little to none boilerplate, and for moments such as phoenix things, there are configurable generators. I wouldn’t want an AI incapable of problem solving to generate complex code for me, because as tempting as it seems, the productivity decreases a lot if we talk about refactoring generated code compared to creating your own new code. D4no0 https://elixirforum.com/t/get-ai-code-generation-tools-to-create-correct-elixir-code-or-else/53931/2
11 Perl ✅ N/A ✅ N/A 2.46% 29 67,938 125,129 634,214 117,426 188,697 5.5 4.7 0 0 0 16.4k https://www.reddit.com/r/perl/ There are a few problems with this, and I noticed the exact same thing with the GitHub Copilot. It's barfing out examples it was trained on with no idea about what they do, whether they work, and if they are current. Transaction objects no longer have a success method. This was deprecated for a long time ago and finally removed in version 9. The error method returns a single value. Minor problem, but still cruft that shouldn't be there. Call json on the response to get the data structure rather than doing this yourself. Even then, using JSON directly, while fine, skips over the Mojo::JSON::decode_json. It's a bit of a pain in the butt, but work hard to use the same parser everywhere in an application since they tend to have slight differences (say, like how they represent null, true, or false). Somewhere along the line, ChatGPT saw this code or something very similar. It then returns it to you with no intelligence about what it is doing or what it should do. It's very likely that the source ChatGPT saw is not only old, but also unsophisticated. You're likely just cargo-culting off StackOverflow with extra steps. But, this also isn't the way you probably want to write code. You don't want to return the token really, You want to add that to the user-agent so it provides it in every request without additional code from you. I have plenty of examples in Mojo Web Clients. That's another problem with the source material for these sorts of things: it's training itself off public data, but often our examples are mere demonstrations of ideas rather than advice on reliable software engineering (since we aren't going to write a book for every question someone asks). u/briandfoy https://www.reddit.com/r/perl/comments/10j0k00/comment/j5ki948 "Somewhere along the line, ChatGPT saw this code or something very similar. It then returns it to you with no intelligence about what it is doing or what it should do." IMO, this is quite irrelevant, because you must understand that whatever output - be it code, poems or whatever - from an AI-assisted service is not perfect. The main point is: it helps. And that's its main selling point today, because that's how StackOverflow also works: sometimes it's perfect, but most of the times it just helps, maybe because you have addressed the wrong audience, didn't word your question/problem correctly or otherwise. With ChatGPT you get an instant reply, and you can ask it to refine its reply. Instantly. Rinse and repeat. So if it use StackOverflow data (which I assume it does) it's already better in the sense that it's instant and filters out noise, especially personal attacks, or otherwise replies that intimidates the person asking the questions. "It then returns it to you with no intelligence about what it is doing or what it should do." Let's be honest, we have all been there and/or we have had colleagues who fits that description. :) u/nobono https://www.reddit.com/r/perl/comments/10j0k00/comment/j5l9s1c/ You mentioned being new to perl and programming. Personally, I think ChatGPT is a great resource for these types of question. I asked it your question and copied the function from csv2fasta.pl u/its_a_gibibyte https://www.reddit.com/r/perl/comments/14capfv/comment/jol2a4b
12 Scala ✅ N/A ✅ N/A 2.77% 28 111,969 605,988 1,508,526 271,184 540,327 14.87 3.87 4.1 0 1.8 51.3k https://www.reddit.com/r/scala/ Today I decided to test it by asking how one would use Scala 3 macros to get the types of the inputs and outputs of a method. It had some decent suggestions to do that for someone that is new to macros, but a lot of its answer was false, suggesting people use something called QuotesContext, not recognizing properly what extension methods are available for the Symbol type, and worst of all, trying to splice Type values into an Expr. If they can manage to get chatgpt to actually tell the truth consistently (like saying "I don't know how to do that" rather than just lying) I think it will be a nice resource for discovering how to do stuff you don't currently know how to do. Sadly, it's still got a nasty habit of making stuff up. u/markehammons https://www.reddit.com/r/scala/comments/124ocqh/scala_and_chatgpt/ Well...this is a very hold thread but I'm using the latest copilot for scala available today of this post. I mostly use the ZIO framework. I was skeptical at first but I'm finding the suggestions get smart quickly and it is generating a lot of code fragments pretty well. I'm not claiming I can live without it, but as of today, I'm thinking it works pretty well for my scenarios. I could easily see not wanting to code without in the near future. I think using a framework like ZIO makes it easier to generate code fragments because the ZIO framework has a fairly predictable surface area, but that's just a guess. u/agilesteel https://www.reddit.com/r/scala/comments/ovoc8n/github_copilot_for_scala_does_it_work/ I wanted to start a new Scala project based on Clean Architecture aka dependency inversion. So I asked for a basic example to demo the principles. There was a lot of pretty code but ultimately it had no idea what this was about. The code was bs. u/k1v1uq https://www.reddit.com/r/ChatGPTCoding/comments/zpunkt/comment/j25ftsr/?utm_source=share&utm_medium=web2x&context=3
13 Delphi N/A N/A N/A N/A 3.23% 27 51,475 310 552 0 0 0 0 0 0 0 3.8k reddit.com/r/delphi PSA: GitHub Copilot works with Delphi u/EasywayScissors https://www.reddit.com/r/delphi/comments/wnhk9x/psa_github_copilot_works_with_delphi/?utm_source=share&utm_medium=web2x&context=3 As you can see, it is possible to use an AI for simple pieces of code to create basic Delphi code quickly. We can now go one step further and implement this in Delphi itself. Marco Geuze https://gdksoftware.com/knowledgebase/delphi-and-chatgpt I asked a series of Pascal programming questions to an AI chatbot system while testing its abilities, and the following page is a record of its responses. u/sysrpl https://www.reddit.com/r/delphi/comments/1006ybh/programming_pascal_using_an_ai_chatbot/?utm_source=share&utm_medium=web2x&context=3
14 Groovy N/A N/A N/A N/A 3.40% 26 30,014 132,381 431,291 108,265 140,122 Unspecified 0 0 0 0 3.0k https://www.reddit.com/r/groovy/ And that it was possible to use the code created by the tool to generate some code that could be used to start your programming. This could save quite a bit of time for developers to use this as a starting point, and you don’t need to have a large experience to start coding in UDFs in Groovy. It is also interesting that it has much knowledge about what is going on in an SAP universe, I would have thought it was more difficult to get data about it. Figaf https://figaf.com/chatgpt-groovy-code-help-for-sap-cloud-integration/ Groovy is a great language with a ton of utility, and can scale like crazy! Write code as dynamic as you want, and choose to refactor into a more type-safe manner later. It's totally worth learning and having it in your toolkit. I program in it every day for many projects. All Java (99.9%) is also valid Groovy, so it's almost impossible not to understand and work with any Java code base you may come across once you get familiar with Groovy. ChatGPT and Github Co-pilot also write excellent Groovy code, which can aid you in learning, and just programming with it in general. It's still actively maintained, too! It's not going away an time soon. u/West_Performance_129 https://www.reddit.com/r/groovy/comments/16kuh6s/comment/k1i0lqn/ When I was building react-native-colo-loco, I had to write a Gradle script, which is written in Groovy. I know a little Groovy, but not much. So I focused on writing precise, accurate comments, and let Copilot suggest lines of code. I could then lean on my development experience to pick up on patterns and syntax, and go from there. Jamon Holmgren https://shift.infinite.red/getting-the-most-from-github-copilot-8f7b32014748