Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port varnamc ruby CLI to C #154

Open
subins2000 opened this issue Aug 16, 2020 · 8 comments
Open

Port varnamc ruby CLI to C #154

subins2000 opened this issue Aug 16, 2020 · 8 comments

Comments

@subins2000
Copy link
Member

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
Copy link
Member Author

@athul is trying a rewrite of varnamc in Go

@subins2000 subins2000 changed the title Remove ruby for varnamc CLI Remove ruby for varnamc CLI, Perhaps rewrite in Go Sep 10, 2020
@joicemjoseph
Copy link

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
Copy link
Member Author

@joicemjoseph I agree, C would the right way

@subins2000
Copy link
Member Author

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

@subins2000
Copy link
Member Author

@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 subins2000 changed the title Remove ruby for varnamc CLI, Perhaps rewrite in Go Port varnamc ruby CLI to C Sep 13, 2020
@subins2000
Copy link
Member Author

subins2000 commented Sep 15, 2020

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
Copy link

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
Copy link
Member Author

subins2000 commented Oct 29, 2021

@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 (#157) but dependency management in C is troublesome especially for cross-platform compatibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants