varnamproject / libvarnam

Deprecated. See https://github.com/varnamproject/govarnam
http://www.varnamproject.com
Mozilla Public License 2.0
100 stars 21 forks source link

Port varnamc ruby CLI to C #154

Open subins2000 opened 4 years ago

subins2000 commented 4 years ago

Ruby dependency can be avoided if varnamc is written in C itself or Python or Go to reduce dependencies. After making the flatpak package, I realize that Ruby uses 40MB+ for its dependency.

What do you think @navaneeth ?

cc @joicemjoseph interested ?

subins2000 commented 4 years ago

@athul is trying a rewrite of varnamc in Go

joicemjoseph commented 4 years ago

I dont think that is the best way to do.

  1. I am just curious to know why he used Ruby instead of C, while he wrote everything in C.
  2. If you ask me for a choice, I would prefer C than Go, because the build process would be straight forward.
subins2000 commented 4 years ago

@joicemjoseph I agree, C would the right way

subins2000 commented 4 years ago

I'd like to give it a go in C. Let's see :sweat_smile:

subins2000 commented 4 years ago

@joicemjoseph Found this : http://savannah.nongnu.org/bugs/?40807

Varnam is segregated, there's savannah, gitlab, and github. We should make one canonical. I'd say with GitLab, let's do some standardization for future contributions too.

subins2000 commented 4 years ago

All the current Varnam Scheme Files (Docs) are in ruby, compiling scheme files therefore need Ruby. Instead of a config file, having a Ruby file is advantageous, yes, but this goal is to port varnamc to C. It's super difficult to implement the current varnamc's --compile option in C. So, I'm not gonna implement it.

Workaround

Provide the compiled .vst binary (they're actually SQLite DB file) for production use. Here are the filesizes :

$ du -h schemes/*.vst
12M     schemes/as.vst
12M     schemes/bn.vst
9.2M    schemes/gu.vst
6.3M    schemes/hi.vst
224K    schemes/kn.vst
52K     schemes/ml-inscript.vst
648K    schemes/ml.vst
18M     schemes/mr.vst
19M     schemes/ne.vst
12M     schemes/or.vst
5.4M    schemes/pa.vst
7.5M    schemes/sa.vst
152K    schemes/ta.vst
192K    schemes/te.vst

These files are downloadable from here, but I'm not sure if they're up to date.

pythonhacker commented 3 years ago

I just saw the (slightly weird) dependency on Ruby after building libvarnam and felt the same. Also this is not mentioned anywhere in the README which is a bigger problem. One gets in a bit of a rabbit hole after the ruby installation -> then the ffi gem -> which requires ruby-dev -> etc.

subins2000 commented 3 years ago

@pythonhacker Yes I went through the same issue when I started with libvarnam. GoVarnam fixes this by having the CLI tool written in Go itself.

I did give this a go (pun intended ;)) in C (https://github.com/varnamproject/libvarnam/pull/157) but dependency management in C is troublesome especially for cross-platform compatibility.