A Bengali (বাংলা) version of the Go compiler and toolchain
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.github
api unicode: upgrade to version 9.0.0 Jun 28, 2016
doc spec: clarify text on init functions Aug 26, 2016
lib/time lib/time: update to IANA release 2016f (July 2016) Jul 7, 2016
misc go/build: don't alter InstallSuffix for default compile options Aug 26, 2016
src Add koro compiler and gofmt Bengali->English translation Sep 15, 2016
test cmd/compile: add MIPS64 optimizations, SSA on by default Aug 26, 2016
.gitattributes .gitattributes: prevent all magic line ending changes Dec 12, 2014
.gitignore cmd/go: fail with nice error message on bad GOOS/GOARCH pair May 6, 2016
.travis.yml Use Docker build in .travis.yml Aug 27, 2017
AUTHORS
CONTRIBUTING.md Fix CONTRIBUTING.md Aug 18, 2017
CONTRIBUTORS A+C: automated updates Jun 24, 2016
Dockerfile
LICENSE Update owner in LICENSE Sep 15, 2016
PATENTS
README.md Fixing the logo url (#12) Mar 14, 2018
favicon.ico website: recreate 16px and 32px favicon Aug 25, 2016
gopher_tiger.svg
koro_hello_world.go
robots.txt godoc: serve robots.txt raw Feb 18, 2011

README.md

Build Status

করো

করো (koro) is an extension of the Go compiler and toolchain to support programming in Bengali (বাংলা).

You can read this README in English or in Bengali.

করো go কম্পাইলারের একটি এক্সটেনশন এবং বাংলা ভাষায় প্রোগ্রামিং করার টুলচেইন।

এই রিডমিটা ইংরেজি আর বাংলাতে পড়তে পারো।

বাংলা

করো(koro) go কম্পাইলারের একটি এক্সটেনশন এবং বাংলা ভাষায় প্রোগ্রামিং করার টুলচেইন।

go কম্পাইলারকে যেভাবে কম্পাইল করা হয়, তেমনি ভাবেই কর কেও কম্পাইল করা যাবে। তোমার দরকার go কম্পাইলারের একটি বাইনারী কপি অথবা কর এর কোনো আগের version।

$ cd src/
$ ./all.bash

উপরের কমান্ড বিন (bin/) ফোল্ডারে দুইটা ফাইল তৈরি করবে - একটা হল go, আরেকটি gofmt। প্রোগ্রামিং করার সময় যেন কোন সন্দেহ বা অসুবিধা না হয়, সে জন্য উপরিল্লেখিত ফাইল দুটি রিনেম করে koro এবং korofmt করা যায়। যদিও একই ফাইল ব্যবহার করে ইংরেজি ভাষায় go কোড লিখা যাবে।

ইংরেজি go আর বাংলা go এর সিনটেক্সে কোন তারতম্য নাই। এক্ষেত্রে ইংরেজি এর সাথে বাংলা go প্রোগ্রামিং এর ক্ষেত্রে বাংলা কিওয়ার্ডগুলোও ভ্যালিড। বাংলার সব ভ্যালিড কিওয়ার্ডগুলো গুলো হল -

ভাঙ্গা, ক্ষেত্রে, চ্যানেল, ধ্রুবক, চলো, ডিফল্ট, মুলতবি, অন্যভাবে, নির্ঝর, যখনই,, কর,লাফ,যদি,আমদানি,ইন্টারফেস,অভিধান,প্যাকেজ,প্রতিটি,ফিরুন,নির্বাচন, গঠন, সুইচ,ধরনের, পরিবর্তনশীল

উদাহরণ - এটা সবার জানা "হ্যালো ওয়ার্ন্ড" প্রোগ্রাম,

প্যাকেজ main

আমদানি "fmt"main(){
    যদি true {
    fmt.Println("Hello, world!")
  }
}

যেমন করে ইংরেজি go কম্পাইলার দিয়ে go প্রোগ্রাম কম্পাইল করা হয় - go build, go run, তেমনি ভাবেই, এই প্রোগ্রাম ও কম্পাইল করা সম্ভব। যদি কম্পাইলারের নাম পরিবতন করে koro করে থাক, তবে, উপরের প্রোগ্রাম নিচের কমান্ড লিখেই রান করা যাবে -

sh
$ koro run koro_hello_world.go

koro এর কোড ইংরেজিতে অনুবাদ করার জন্য, শুধু রান কর korofmt। বাংলা এর ক্ষেত্রে go কম্পাইলার ফ্ল্যাগের কোন পরিবতন হবে না, অর্থাৎ ইংরেজি ও বাংলার জন্য একই রকম থাকবে। যেমন -

sh
$ korofmt koro_hello_world.go

এই কমান্ড কনসলে (বা STDOUT) এ বাংলা অংশটুকু অটোমেটিক ভাবে ইংরেজি করে দিবে।

go
package main

import "fmt"

func main() {
	if true {
		fmt.Println("Hello, world!")
	}
}

English

করো (koro) is an extension of the Go compiler and toolchain to support programming in Bengali (বাংলা).

Building the করো toolchain

Compiling করো is similar to compiling the Go compiler from scratch. You will need either a binary copy of the Go compiler (version 1.4 or higher), or a previous version of করো

$ cd src/
$ ./all.bash

This will create two files in bin/ - one named go and one named gofmt. It is recommended to rename or symlink these to koro and korofmt before adding them to your path to avoid confusion; however, these can be used to compile English Go code as well.

Writing in করো

The syntax of করো is exactly the same as the syntax of English Go, except that Bengali keywords are valid syntax. The full list of Bengali করো keywords is:

ভাঙ্গা, ক্ষেত্রে, চ্যানেল, ধ্রুবক, চলো, ডিফল্ট, মুলতবি, অন্যভাবে, নির্ঝর, যখনই,, কর,লাফ,যদি,আমদানি,ইন্টারফেস,অভিধান,প্যাকেজ,প্রতিটি,ফিরুন,নির্বাচন, গঠন, সুইচ,ধরনের, পরিবর্তনশীল

For example, this is a "Hello, world" program:

প্যাকেজ main

আমদানি "fmt"main(){
    যদি true {
    fmt.Println("Hello, world!")
  }
}

Running your program works identically to the English Go compiler -go build, go run, etc. Assuming you have named your করো compiler as koro, you can run this program with:

$ koro run koro_hello_world.go

Translating করো to English Go

To translate করো code into English, simply run korofmt. The flags are identical to gofmt. For example:

$ korofmt koro_hello_world.go

will write the following to STDOUT:

package main

import "fmt"

func main() {
	if true {
		fmt.Println("Hello, world!")
	}
}

Contributions

Contributions welcome. And most importantly, মজা করো!

Gopher image