common-words icon indicating copy to clipboard operation
common-words copied to clipboard

Can you add support for more languages?

Open gnu-user opened this issue 7 years ago • 25 comments

Love your project, very interesting read! Would it be possible for you to add support for additional languages such as Lisp, SQL, Clojure, Rust, etc?

Thanks!

gnu-user avatar Jan 18 '17 22:01 gnu-user

Kotlin and Rust would be cool!

mbStavola avatar Jan 18 '17 23:01 mbStavola

How about CMake?

dooglio avatar Jan 19 '17 01:01 dooglio

Clojure / ClojureScript would be awesome!

chrisetheridge avatar Jan 19 '17 06:01 chrisetheridge

Absolutely!

I added sql (all files with .sql extension): https://anvaka.github.io/common-words/#?lang=sql And rust (all files with .rs extension): https://anvaka.github.io/common-words/#?lang=rust

What would be the most accurate file extension for Clojure/Lisp/Kotlin/CMake?

anvaka avatar Jan 19 '17 06:01 anvaka

How about Swift and Obj-C?

quangdatv avatar Jan 19 '17 08:01 quangdatv

Clojure / ClojureScript files all use the extension of .clj and .cljs respectively.

chrisetheridge avatar Jan 19 '17 08:01 chrisetheridge

How about .R and .r for the R language??

rmflight avatar Jan 19 '17 15:01 rmflight

@anvaka And if you could also add Common Lisp while you're adding Clojure I would really appreciate it! The extensions for Common Lisp are most frequently .lisp or .lsp .

gnu-user avatar Jan 19 '17 16:01 gnu-user

@rmflight I had R before. Unfortunately visualizations were not usable for R - they were made mostly from numbers. That's because I can only differentiate languages by file extension. As it turned out .r was also used for resource files, which looked mostly like an assembly language (thus the numbers)

anvaka avatar Jan 20 '17 06:01 anvaka

Added:

Please let me know if something doesn't make sense or is missing

anvaka avatar Jan 20 '17 06:01 anvaka

For CMake, I love that you made it in the shape of the Kitware logo!

dooglio avatar Jan 20 '17 06:01 dooglio

Thanks @anvaka this looks great! While on functional languages you could also try adding Haskell, the file extension most commonly used is .hs or .lhs also in terms of rendering the word cloud Haskell has a great logo.

You can find a high resolution version of the logo at the following URL: https://upload.wikimedia.org/wikipedia/commons/thumb/1/1c/Haskell-Logo.svg/2000px-Haskell-Logo.svg.png

gnu-user avatar Jan 20 '17 15:01 gnu-user

Requesting Elixir.

derekbrown avatar Jan 20 '17 15:01 derekbrown

Added both:

anvaka avatar Jan 20 '17 16:01 anvaka

If you add Objective-C, keep in mind that .h is a header format shared across multiple languages, and .m is shared with Matlab (I think). You might need more advanced heuristics to figure out what language a file is. There may be some good language detection in cloc that you can use for inspiration.

ZevEisenberg avatar Jan 20 '17 22:01 ZevEisenberg

That's very nice! Could you please add support for F#? .fs and .fsi are the extensions.

ForNeVeR avatar Jan 21 '17 04:01 ForNeVeR

@ZevEisenberg yes, unfortunately I don't have anything advanced yet. I guess one could use user defined function which would classify source code text more accurately...

For now I'm just considering .m and .mm as objective c/c++ code.

@ForNeVeR the same is true about .fs extension - I know Forth, GLSL, and Filterscript are using it. Please let me know if you see anything suspicious...

anvaka avatar Jan 22 '17 00:01 anvaka

This is great! Would you be up for adding PureScript (.purs) and elm (.elm)?

joneshf avatar Jan 24 '17 12:01 joneshf

Added

anvaka avatar Jan 24 '17 15:01 anvaka

@rmflight I added R language. I used case sensitive .R extension and results seems better than for .r (which was mixed with resource files). Please let me know if something doesn't look right:

https://anvaka.github.io/common-words/#?lang=r

anvaka avatar Jan 25 '17 15:01 anvaka

Erlang is here

anvaka avatar Jan 25 '17 15:01 anvaka

@anvaka That actually looks like it is capturing the relevant semantics of the language! Thank you!

rmflight avatar Jan 25 '17 15:01 rmflight

Awesome visualizer! I'd like to request the addition of Groovy (.groovy).

The logo is quite busy, Groovy logo but there's a simplified version used as an icon for their console. Groovy Console icon

bdkosher avatar Jan 28 '17 16:01 bdkosher

@bdkosher here it is

anvaka avatar Jan 29 '17 02:01 anvaka

How about Haxe (.hx)? :)

nadako avatar Nov 13 '20 11:11 nadako