# Example Erlang codes sourced from open-source projects

**URL:** <https://erlangforums.com/t/example-erlang-codes-sourced-from-open-source-projects/1940>\
**Category:** Questions / Help\
**Tags:** erlang-otp\
**Created:** [October 14, 2022, 12:10pm UTC](https://erlangforums.com/t/example-erlang-codes-sourced-from-open-source-projects/1940 "2022-10-14T12:10:32Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohan](https://erlangforums.com/user_avatar/erlangforums.com/mohan/32/1657_2.png) [@mohan](https://erlangforums.com/u/mohan)\
**Post date:** [October 14, 2022, 12:10pm UTC](https://erlangforums.com/t/example-erlang-codes-sourced-from-open-source-projects/1940/1 "2022-10-14T12:10:32Z")

</div>

I have recently migrated from Java to Erlang.

Documentation such as [Erlang Std](https://www.erlang.org/doc/apps/stdlib/index.html) explains individual APIs.

For Java, there are websites that aggregate example code from open-source projects for a given API, keyword, etc. For example, [Java Code Example Search](https://www.programcreek.com/java-api-examples/). Such sites help to understand the usage of a given API in different scenarios. It also helps to understand how a set of APIs could be **collectively used** for different scenarios in the correct order.

Is there any similar site for Erlang? Please clarify.

---

<div class="post-metadata">

**Author:** ![mohan](https://erlangforums.com/user_avatar/erlangforums.com/mohan/32/1657_2.png) [@mohan](https://erlangforums.com/u/mohan)\
**Post date:** [October 31, 2022, 4:33pm UTC](https://erlangforums.com/t/example-erlang-codes-sourced-from-open-source-projects/1940/2 "2022-10-31T16:33:14Z")

</div>

I found one site [https://searchcode.com/](https://searchcode.com/). It refers to open-source code available in various sources such as github, Google code, etc. It is not on par with Java sites. Something is better than nothing.

Please update this thread whenever you find similar sites.

---

<div class="post-metadata">

**Author:** ![kanga-roo](https://erlangforums.com/user_avatar/erlangforums.com/kanga-roo/32/1081_2.png) [@kanga-roo](https://erlangforums.com/u/kanga-roo)\
**Post date:** [November 5, 2022, 6:47am UTC](https://erlangforums.com/t/example-erlang-codes-sourced-from-open-source-projects/1940/3 "2022-11-05T06:47:20Z")

</div>

Have you tried;

> **[Category:Programming Tasks](https://rosettacode.org/wiki/Category:Programming_Tasks)**
>
> Programming tasks are problems that may be solved through programming. When such a task is defined, Rosetta Code users are encouraged to solve them using as many...

> **[Category:Erlang](https://rosettacode.org/wiki/Category:Erlang)**
>
> Erlang is a programming language which has many features more commonly associated with an operating system than with a programming language: concurrent processes...

Happy browsing!

---

<div class="post-metadata">

**Author:** ![mohan](https://erlangforums.com/user_avatar/erlangforums.com/mohan/32/1657_2.png) [@mohan](https://erlangforums.com/u/mohan)\
**Post date:** [November 6, 2022, 2:28pm UTC](https://erlangforums.com/t/example-erlang-codes-sourced-from-open-source-projects/1940/4 "2022-11-06T14:28:25Z")

</div>

Thank @kanga-roo. Useful site. I see it is a good site to search example code for a given problem. But, it does not allow to search example code for a given string say a function name.

---

<div class="post-metadata">

**Author:** ![nzok](https://erlangforums.com/letter_avatar_proxy/v4/letter/n/4af34b/32.png) [@nzok](https://erlangforums.com/u/nzok)\
**Post date:** [November 6, 2022, 10:52pm UTC](https://erlangforums.com/t/example-erlang-codes-sourced-from-open-source-projects/1940/5 "2022-11-06T22:52:18Z")

</div>

There’s a scrape of all the examples from RosettaCode at  
[https://github.com/acmeism/RosettaCodeData](https://github.com/acmeism/RosettaCodeData)  
but the Erlang code was last updated 3 years ago.  
You can download that lot and search it how you will.

I studied the Rosetta Code examples in a bunch of languages  
in some depth a few years ago. This is code written by  
people with time on their hands and can often be substantially  
improved. For instance, it’s not terribly rare for submissions  
not to solve the intended problem at all.

---

<div class="post-metadata">

**Author:** ![mohan](https://erlangforums.com/user_avatar/erlangforums.com/mohan/32/1657_2.png) [@mohan](https://erlangforums.com/u/mohan)\
**Post date:** [December 20, 2022, 4:46am UTC](https://erlangforums.com/t/example-erlang-codes-sourced-from-open-source-projects/1940/6 "2022-12-20T04:46:45Z")

</div>

Another site is [Category:Programming language:Erlang - LiteratePrograms](https://literateprograms.org/category_programming_language_erlang.html)

---

<div class="post-metadata">

**Author:** ![eproxus](https://erlangforums.com/user_avatar/erlangforums.com/eproxus/32/452_2.png) [@eproxus](https://erlangforums.com/u/eproxus)\
**Post date:** [December 20, 2022, 7:52am UTC](https://erlangforums.com/t/example-erlang-codes-sourced-from-open-source-projects/1940/7 "2022-12-20T07:52:02Z")

</div>

GitHub also has a quite useful global code search: [https://github.com/search?q=lists%3Afoldl+language%3AErlang&type=code&l=Erlang](https://github.com/search?q=lists%3Afoldl+language%3AErlang&type=code&l=Erlang)

(You might have to apply for the new beta for it, not sure…)

---

<div class="post-metadata">

**Author:** ![mohan](https://erlangforums.com/user_avatar/erlangforums.com/mohan/32/1657_2.png) [@mohan](https://erlangforums.com/u/mohan)\
**Post date:** [December 23, 2022, 10:06am UTC](https://erlangforums.com/t/example-erlang-codes-sourced-from-open-source-projects/1940/8 "2022-12-23T10:06:45Z")

</div>

Thanks Adam. That’s useful
