add erlang

This commit is contained in:
Ty Dunn 2023-11-06 15:15:47 -08:00
parent 2b3f240201
commit b9c15db2e8
3 changed files with 174 additions and 0 deletions

View file

@ -0,0 +1,61 @@
# Erlang
Recently, many folks have been claiming that their LLM is the best at coding. Their claims are typically based off self-reported evaluations on the [HumanEval benchmark](https://blog.continue.dev/an-introduction-to-code-llm-benchmarks-for-software-engineers/#:~:text=most%20common%20benchmarks-,1.%20HumanEval,-Creator%3A%20OpenAI). But when you look into that benchmark, you realize that *it only consists of 164 Python programming problems.*
This led me down a rabbit hole of trying to figure out how helpful LLMs actually are with different programming, scripting, and markup languages. I am estimating this for each language by reviewing LLM code benchmark results, public LLM dataset compositions, available GitHub and Stack Overflow data, and anecdotes from developers on Reddit. Below you will find what I have figured out about Erlang so far.
**Do you have any feedback or perhaps some anecdotes about using LLMs with Erlang to share?**
---
Erlang is the #38 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
❌ Erlang 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)
❌ Erlang 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)
❌ Erlang 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)
❌ Erlang 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
❌ Erlang is not included in [The Stack dataset](https://arxiv.org/abs/2211.15533)
❌ Erlang is not included in the [CodeParrot dataset](https://huggingface.co/datasets/codeparrot/github-code)
❌ Erlang is not included in the [AlphaCode dataset](https://arxiv.org/abs/2203.07814)
❌ Erlang is not included in the [CodeGen dataset](https://arxiv.org/abs/2203.13474)
❌ Erlang is not included in the [PolyCoder dataset](https://arxiv.org/abs/2202.13169)
## Stack Overflow & GitHub presence
Erlang has 9,621 [tags on Stack Overflow](https://stackoverflow.com/tags)
Erlang projects have had 70,890 [PRs on GitHub since 2014](https://madnight.github.io/githut/#/pull_requests/2023/3)
Erlang projects have had 49,786 [issues on GitHub since 2014](https://madnight.github.io/githut/#/issues/2023/3)
Erlang projects have recieved 249,209 [pushes on GitHub since 2014](https://madnight.github.io/githut/#/pushes/2023/3)
Erlang projects have recieved 127,120 [stars on GitHub since 2014](https://madnight.github.io/githut/#/stars/2023/3)
## Anecdotes from developers
[u/Ranugad](https://www.reddit.com/r/erlang/comments/11kl57z/comment/jbbw94t)
> It seems like ChatGPT doesn't know that much Erlang.
[Rich_Morin](https://elixirforum.com/t/asking-chatgpt-to-translate-erlang-to-elixir/53548)
> I recently asked ChatGPT to translate some Erlang code into Elixir. Here’s an edited transcript, for your amusement and edification…
[u/boy-griv](https://www.reddit.com/r/AskProgramming/comments/10tave8/comment/j78bvj5)
> I don’t think anything automated is going to work well. ChatGPT might be interesting but you’ll almost certainly have to fix it up quite a bit. https://learnxinyminutes.com/docs/erlang/ gives a quick rundown on erlang syntax/semantics and https://learnyousomeerlang.com/ is a good book on it
---
Original source: https://github.com/continuedev/continue/tree/main/docs/docs/languages/erlang.md
Data for all languages I've looked into so far: https://github.com/continuedev/continue/tree/main/docs/docs/languages/languages.csv

View file

@ -0,0 +1,112 @@
import csv
data = {}
with open('languages.csv', 'r') as file:
reader = csv.DictReader(file)
for row in reader:
data = row
break
language = data['language']
stack_overflow_ranking = data['so_2023_language_rank']
introduction = f'''# {language}
Recently, many folks have been claiming that their LLM is the best at coding. Their claims are typically based off self-reported evaluations on the [HumanEval benchmark](https://blog.continue.dev/an-introduction-to-code-llm-benchmarks-for-software-engineers/#:~:text=most%20common%20benchmarks-,1.%20HumanEval,-Creator%3A%20OpenAI). But when you look into that benchmark, you realize that *it only consists of 164 Python programming problems.*
This led me down a rabbit hole of trying to figure out how helpful LLMs actually are with different programming, scripting, and markup languages. I am estimating this for each language by reviewing LLM code benchmark results, public LLM dataset compositions, available GitHub and Stack Overflow data, and anecdotes from developers on Reddit. Below you will find what I have figured out about {language} so far.
**Do you have any feedback or perhaps some anecdotes about using LLMs with {language} to share?**
---
'''
stack_overflow = f'''{language} is the #{stack_overflow_ranking} 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).\n\n'''
benchmarks = "## Benchmarks\n\n"
if data["multiple"] == "N/A":
multiple = f'''❌ {language} 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)\n\n'''
else:
multiple = f'''✅ {language} is 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)\n\n'''
if data["babel"] == "N/A":
babel = f'''❌ {language} 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)\n\n'''
else:
babel = f'''✅ {language} is 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)\n\n'''
if data["mbxp"] == "N/A":
mbxp = f'''❌ {language} 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)\n\n'''
else:
mbxp = f'''✅ {language} is 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)\n\n'''
if data["humaneval_x"] == "N/A":
humaneval_x = f'''❌ {language} 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)\n\n'''
else:
humaneval_x = f'''✅ {language} is 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)\n\n'''
datasets = "## Datasets\n\n"
if data["stack_gb"] == "0":
stack = f'''❌ {language} is not included in [The Stack dataset](https://arxiv.org/abs/2211.15533)\n\n'''
else:
stack = f'''✅ {language} makes up {data["stack_gb"]} GB of [The Stack dataset](https://arxiv.org/abs/2211.15533)\n\n'''
if data["codeparrot_gb"] == "0":
codeparrot = f'''❌ {language} is not included in the [CodeParrot dataset](https://huggingface.co/datasets/codeparrot/github-code)\n\n'''
else:
codeparrot = f'''✅ {language} makes up {data["codeparrot_gb"]} GB of the [CodeParrot dataset](https://huggingface.co/datasets/codeparrot/github-code)\n\n'''
if data["alphacode_gb"] == "0":
alphacode = f'''❌ {language} is not included in the [AlphaCode dataset](https://arxiv.org/abs/2203.07814)\n\n'''
else:
alphacode = f'''✅ {language} makes up {data["alphacode_gb"]} GB of the [AlphaCode dataset](https://arxiv.org/abs/2203.07814)\n\n'''
if data["codegen_gb"] == "0":
codegen = f'''❌ {language} is not included in the [CodeGen dataset](https://arxiv.org/abs/2203.13474)\n\n'''
else:
codegen = f'''✅ {language} makes up {data["codegen_gb"]} GB of the [CodeGen dataset](https://arxiv.org/abs/2203.13474)\n\n'''
if data["polycoder_gb"] == "0":
polycoder = f'''❌ {language} is not included in the [PolyCoder dataset](https://arxiv.org/abs/2202.13169)\n\n'''
else:
polycoder = f'''✅ {language} makes up {data["polycoder_gb"]} GB of the [PolyCoder dataset](https://arxiv.org/abs/2202.13169)\n\n'''
presence = f'''## Stack Overflow & GitHub presence
{language} has {data["so_tags"]} [tags on Stack Overflow](https://stackoverflow.com/tags)
{language} projects have had {data["github_prs"]} [PRs on GitHub since 2014](https://madnight.github.io/githut/#/pull_requests/2023/3)
{language} projects have had {data["github_issues"]} [issues on GitHub since 2014](https://madnight.github.io/githut/#/issues/2023/3)
{language} projects have recieved {data["github_pushes"]} [pushes on GitHub since 2014](https://madnight.github.io/githut/#/pushes/2023/3)
{language} projects have recieved {data["github_stars"]} [stars on GitHub since 2014](https://madnight.github.io/githut/#/stars/2023/3)
'''
anecdotes = f'''## Anecdotes from developers
[{data["anecdote_1_author"]}]({data["anecdote_1_url"]})
> {data["anecdote_1_content"]}
[{data["anecdote_2_author"]}]({data["anecdote_2_url"]})
> {data["anecdote_2_content"]}
[{data["anecdote_3_author"]}]({data["anecdote_3_url"]})
> {data["anecdote_3_content"]}
---
'''
conclusion = f'''Original source: https://github.com/continuedev/continue/tree/main/docs/docs/languages/{language.lower()}.md
Data for all languages I've looked into so far: https://github.com/continuedev/continue/tree/main/docs/docs/languages/languages.csv
'''
content = introduction + stack_overflow + benchmarks + multiple + babel + mbxp + humaneval_x + datasets + stack + codeparrot + alphacode + codegen + polycoder + presence + anecdotes + conclusion
with open(f'{language.lower()}.md', 'w') as f:
f.write(content)

View file

@ -1,2 +1,3 @@
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
Erlang,N/A,N/A,N/A,N/A,0.99%,38,"9,621","70,890","249,209","49,786","127,120",0,0,0,0,0,9.5k,https://www.reddit.com/r/erlang,It seems like ChatGPT doesn't know that much Erlang.,u/Ranugad,https://www.reddit.com/r/erlang/comments/11kl57z/comment/jbbw94t,"I recently asked ChatGPT to translate some Erlang code into Elixir. Here’s an edited transcript, for your amusement and edification…",Rich_Morin,https://elixirforum.com/t/asking-chatgpt-to-translate-erlang-to-elixir/53548,I don’t think anything automated is going to work well. ChatGPT might be interesting but you’ll almost certainly have to fix it up quite a bit. https://learnxinyminutes.com/docs/erlang/ gives a quick rundown on erlang syntax/semantics and https://learnyousomeerlang.com/ is a good book on it,u/boy-griv,https://www.reddit.com/r/AskProgramming/comments/10tave8/comment/j78bvj5
Julia,11,13,N/A,N/A,1.15%,37,"12,402","39,305","166,898","51,276","52,326",3.09,0.29,0,0,0,23.9k,https://reddit.com/r/julia,"I usually start my own articles with ChatGPT but the truth is that right now, if you want to say something interesting in the Julia space, you mostly need to write it yourself since the volume of content about Julia out there isn’t enough for the outputs of ChatGPT to be very useful since our ecosystem is so small.",u/LoganKilpatrick1,https://www.reddit.com/r/Julia/comments/zzvkso/comment/j2i6knx/,"It wasn't trained on sufficient Julia code. As with any machine learning model, ChatGPT is only able to regurgitate what's been fed into it. Also, this behaviour happens with basically every other topic, too. LLMs work by trying to predict what the next word in a sentence would be based on the previous string of words. If a sentence is incomplete, it's going to add a next word. That word is going to be whichever has the highest confidence score, regardless of low that score may actually be. This results in it just making shit up, but often shit that sounds plausible. We've seen CGPT invent academic articles, books, and even entire people because it makes sense to in the sentence it's generating.`",u/Kichae,https://www.reddit.com/r/Julia/comments/112wlle/comment/j8mpgx5/,"I suspect the current language model behind ChatGPT was fed with a lot of code examples from Stack Exchange, but the Julia community mainly uses Discourse instead, which probably wasn't in the training set: https://discourse.julialang.org/",u/Paravalis,https://www.reddit.com/r/Julia/comments/112wlle/comment/j8qzc0j/
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
2 Erlang N/A N/A N/A N/A 0.99% 38 9,621 70,890 249,209 49,786 127,120 0 0 0 0 0 9.5k https://www.reddit.com/r/erlang It seems like ChatGPT doesn't know that much Erlang. u/Ranugad https://www.reddit.com/r/erlang/comments/11kl57z/comment/jbbw94t I recently asked ChatGPT to translate some Erlang code into Elixir. Here’s an edited transcript, for your amusement and edification… Rich_Morin https://elixirforum.com/t/asking-chatgpt-to-translate-erlang-to-elixir/53548 I don’t think anything automated is going to work well. ChatGPT might be interesting but you’ll almost certainly have to fix it up quite a bit. https://learnxinyminutes.com/docs/erlang/ gives a quick rundown on erlang syntax/semantics and https://learnyousomeerlang.com/ is a good book on it u/boy-griv https://www.reddit.com/r/AskProgramming/comments/10tave8/comment/j78bvj5
3 Julia 11 13 N/A N/A 1.15% 37 12,402 39,305 166,898 51,276 52,326 3.09 0.29 0 0 0 23.9k https://reddit.com/r/julia I usually start my own articles with ChatGPT but the truth is that right now, if you want to say something interesting in the Julia space, you mostly need to write it yourself since the volume of content about Julia out there isn’t enough for the outputs of ChatGPT to be very useful since our ecosystem is so small. u/LoganKilpatrick1 https://www.reddit.com/r/Julia/comments/zzvkso/comment/j2i6knx/ It wasn't trained on sufficient Julia code. As with any machine learning model, ChatGPT is only able to regurgitate what's been fed into it. Also, this behaviour happens with basically every other topic, too. LLMs work by trying to predict what the next word in a sentence would be based on the previous string of words. If a sentence is incomplete, it's going to add a next word. That word is going to be whichever has the highest confidence score, regardless of low that score may actually be. This results in it just making shit up, but often shit that sounds plausible. We've seen CGPT invent academic articles, books, and even entire people because it makes sense to in the sentence it's generating.` u/Kichae https://www.reddit.com/r/Julia/comments/112wlle/comment/j8mpgx5/ I suspect the current language model behind ChatGPT was fed with a lot of code examples from Stack Exchange, but the Julia community mainly uses Discourse instead, which probably wasn't in the training set: https://discourse.julialang.org/ u/Paravalis https://www.reddit.com/r/Julia/comments/112wlle/comment/j8qzc0j/