Skip to content

Add 1C (BSL) language support #2773

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

Merged
merged 1 commit into from
Aug 19, 2016
Merged

Conversation

nixel2007
Copy link
Contributor

Hi there!

I would like to add 1C:Enterprise 8 (BSL) language.
1C:Enterprise is a very commonly used platform for automating a company’s financial and wider operational activities in CIS.
Official site (english version): http://1c-dn.com/1c_enterprise/what_is_1c_enterprise/
Russian version: http://v8.1c.ru/

As a grammar i used this Atom package developed by me as a part of xDrivenDevelopment community.

1C:Enterprise uses many file extensions. The main ones are .bsl for modules and .xml for metadata and config-stuff (actually it's an XML files). Those extensions were introdused this autumn, so it's not so much search results (so far) link, but the number of repos will grow fast.

.os extenstion used by external scripts written in 1C (BSL) language as part of OneScript project (no english link, sorry. russian one).

Samples are included for bsl and os.

@pchaigno
Copy link
Contributor

Thanks for the pull request!
Could you link to a search on GitHub for each file extension?

@nixel2007
Copy link
Contributor Author

.bsl - link
.os - link

@nixel2007
Copy link
Contributor Author

@arfon @pchaigno ping?

P.S. Colourful example from github-lightshow.herokuapp.com

@pchaigno
Copy link
Contributor

I counted the number of users and repositories for both file extensions:

File extension Number of users Number of repositories
.os 10 18
.bsl 11 14

Despite the large number of .bsl files (around 8,000 vs. a few hundreds for .os) there does not seem to be many users.

@nixel2007
Copy link
Contributor Author

There are two things about bsl

  1. As I said it's a pretty young format of source storage for 1C. Up to this autumn 1C used the 'txt' extention. Tools for git-flow are in active development and code highlighting in github may greatly stimulate the further growth and popularity on github.
  2. Some apps written on 1C are not allowed to have a unlimited public access, so they may be hidden as private repos.

@pchaigno
Copy link
Contributor

First, I'm not from GitHub, so I won't be making any decision here ;)

Second, while I understand your arguments, there has to be some minimum requirements to add new languages. Linguist has its own limits, in terms of maintainability, memory usage and performance.

Up to this autumn 1C used the 'txt' extention.

This makes me think we could wait a few months for .bsl to gain popularity on GitHub.

@arfon
Copy link
Contributor

arfon commented Jan 22, 2016

This makes me think we could wait a few months for .bsl to gain popularity on GitHub.

Agreed. @nixel2007 - I'm afraid the level of adoption here is too low to be added to Linguist right now. I suggest revisiting this in a few months time.

@arfon arfon closed this Jan 22, 2016
@nixel2007
Copy link
Contributor Author

@pchaigno can you share a script, which downloads repos, please? i want to check the numbers periodicaly.

@ghost
Copy link

ghost commented Apr 24, 2016

Raise discussion.

what we have for now:

  1. before GitHub linguist does not support BSL lang 1C programmers did not want to use GitHub for there code hosting
  2. linguist engine did not want add support for 1C lang because there is no BSL repo on GitHub

we have a deadlock ;-)

Thats why many 1C programmers use there own GitLab and Gogs Servers
and thants why we can not implement GitHub Enterprise in large companies wich use 1C for internal ERP systems

at this point we have to make the mirroring of our repository into an internal gitlab server for code review's, but it's somehow strange

@arfon can you can add language support in order to popularize GitHub for 1C ?

@ghost
Copy link

ghost commented Aug 18, 2016

without much hope I shall ask - any news ?

@nixel2007 may be we need a new pull request ?

currently we have

99 users with 179 repositories

BSL - 114 repos
OS - 66 repos

based on our nigth search https://github.com/allustin/awesome-1c/tree/master/data

@arfon it is enough to prove the usefulness ?

P.S. the worst thing that I can not normally promote Enterprise version for large corporations in Russia...

@nixel2007
Copy link
Contributor Author

I can rebase a PR and add some heuristic, if @arfon gives me a green light

@arfon
Copy link
Contributor

arfon commented Aug 18, 2016

@arfon it is enough to prove the usefulness ?

With my GitHub staff privileges, I'm able to get broad statistics for file extensions on private repos too (I'm not able to view individual files/repos of course) and it looks like there's an order of magnitude more .bsl and .os files on GitHub in private repositories.

I think we should add BSL at this point. @nixel2007 - would you be able to update this PR with the latest changes from master?

@arfon arfon reopened this Aug 18, 2016
@nixel2007 nixel2007 force-pushed the master branch 3 times, most recently from 172affe to f6cc1c0 Compare August 18, 2016 20:14
@nixel2007
Copy link
Contributor Author

nixel2007 commented Aug 18, 2016

@arfon i've rebased and squashed my commits on current master. Also i've added a heuristic for .bsl and .os files to reduce false-positives (mostly for .os).

Travis reports all green. Is current version OK for you?

P.S. I've added licence file manualy cause i can't figure how to run script/licensed without closed source gem :)

/cc @allustin

@pchaigno
Copy link
Contributor

@nixel2007 Thanks for your patience and the quick rebase ⚡
Could you add a test for the heuristic in test_heuristics.rb?

@nixel2007
Copy link
Contributor Author

@pchaigno done.

@pchaigno
Copy link
Contributor

Uh, wait. There's no conflict on these extensions so we won't need heuristic rules (all .os and .bsl files will be associated to 1C anyway). Sorry, I should have checked that first 🙇

@nixel2007
Copy link
Contributor Author

nixel2007 commented Aug 18, 2016

@pchaigno i've added a heurestic because there are a lot *.os non-1C (BSL)-files. will it help?

@pchaigno
Copy link
Contributor

Not unless we can identify what is their language and add support for it. Linguist doesn't have a default or not-a-language option.

@nixel2007
Copy link
Contributor Author

nixel2007 commented Aug 18, 2016

@pchaigno should i add an else section in heurestic (language.yml?) with em... Text language or remove test and heurestic completly?
As I can see Text is not a programming language, so it may be a solution (no statistic at language bar, etc...)

@nixel2007
Copy link
Contributor Author

or we can just leave it as is and add those languages in future

@arfon
Copy link
Contributor

arfon commented Aug 18, 2016

@pchaigno should i add an else section in heurestic (language.yml?) with em... Text language or remove test and heurestic completly?

We should probably remove this completely.

@nixel2007
Copy link
Contributor Author

@arfon done

@arfon arfon merged commit 99a3a5b into github-linguist:master Aug 19, 2016
@arfon
Copy link
Contributor

arfon commented Aug 19, 2016

👍 thanks for this @nixel2007! This will be live with the next release of Linguist (next week sometime)

@nixel2007
Copy link
Contributor Author

Thanks a lot, @arfon and @pchaigno!

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

Successfully merging this pull request may close these issues.

3 participants