Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    randiaz95
    @randiaz95
    Hi
    randiaz95
    @randiaz95
    Seems like py to go compilers are in python2 not 3 yet :D
    Alan Justino da Silva
    @alanjds
    Yes. And the resulting code is not faster for now, for single-threaded applications
    KyleHwang
    @upday7
    does anyone know that how to use grpc in angularDart?
    we use dart in flutter but seems that cannot be compiled in AngularDart ... thakns.
    kannanjmc
    @kannanjmc
    HI
    how to install grumpy
    in mac
    Alan Justino da Silva
    @alanjds
    Hi, @kannanjmc. The easiest way is to pip install grumpy-runtime
    You will need Golang already installed for this to work
    kannanjmc
    @kannanjmc
    great
    thanks
    Alan Justino da Silva
    @alanjds
    also, I strongly suggest you to use a virtualenv
    kannanjmc
    @kannanjmc
    could you please explain why so ?
    Alan Justino da Silva
    @alanjds
    Because without that nobody can 1) know what you already have installed 2) be sure that it will not mess with your working system
    kannanjmc
    @kannanjmc
    thanks Alan
    Alan Justino da Silva
    @alanjds
    3) be sure that the versions your are using are the same that I am using, to reproduce errors/bugs
    Good luck :+1:
    An Long
    @aisk
    Maybe we can ship a dockerfile and publish a docker image on docker hub
    Anatoli Babenia
    @abitrolly
    @aisk ^^^
    Now I need to understand how to get from Python print("%-20s %s" % ('hello', 'world')) to Go.
    Alan Justino da Silva
    @alanjds
    you can put text in a file hello.py then grumpy run hello.py
    Anatoli Babenia
    @abitrolly
    @alanjds can you look into why scheduled tests are failing https://travis-ci.org/github/grumpyhome/grumpy/builds ?
    Anatoli Babenia
    @abitrolly
    It doesn't matter much. PR tests are ok - https://travis-ci.org/github/grumpyhome/grumpy/pull_requests The only annoyance is that the CI status is not visible on PRs pages.
    Alan Justino da Silva
    @alanjds
    image.png

    @alanjds can you look into why scheduled tests are failing https://travis-ci.org/github/grumpyhome/grumpy/builds ?

    Is strange. Two months ago the very same commit passed.

    Maybe something changed on the OSX environment on CI
    Alan Justino da Silva
    @alanjds
    Huh. I rerun the master and passed. Ok then.
    Shah Zain
    @asifjamali83
    I want to convert a complet python script into Go
    if any one can help, ill thankfull,
    Alan Justino da Silva
    @alanjds
    Cool. Have you installed the grumpy tool on CLI?
    Shah Zain
    @asifjamali83
    No bro, i will if you help, also im noob
    Alan Justino da Silva
    @alanjds
    No prob. Please read the README. There are 3 ways to install Grumpy
    Shah Zain
    @asifjamali83
    Ok , i also google there was , pip install grumpy-tools
    Alan Justino da Silva
    @alanjds
    You need Python2.7, Go 1.10+ and make(and friends) preinstalled
    lipsa
    @lipsasenapati
    Hi Everyone, I am new to Grumpy, I am trying to extract Go code from Python code, could someone share the steps to do that?
    image.png
    I used grumpy transpile hello.py and got something like this
    Alan Justino da Silva
    @alanjds
    Well, this seems right.
    (btw, hi @lipsasenapati)
    lipsa
    @lipsasenapati
    @alanjds I was hoping it would look something simple and intuitive like this ..
    func twoSum(nums []int, target int) []int {
    arr := []int{}
    complements := map[int]int{}
    for i :=0; i < len(nums); i++ {
    a := target - nums[i]
    idx, isPresent:= complements[a]
    if isPresent{
    arr = []int{idx, i}
    } else{
    complements[nums[i]] = i
    }
    }
    return arr
    }
    Alan Justino da Silva
    @alanjds

    Yeah. This code is way simpler than the output because it does not implement the Python's exception handling.

    Grumpy translates Python to something about 10x the "simpler" Golang version of the code, in my experience.

    Golang have not the concept of exceptions and it costs CPU, so it had to be implemented with a lot more lines.
    lipsa
    @lipsasenapati
    I see, thanks for the info! @alanjds
    Bill Thorp
    @wthorp
    I looked at Grumpy ages ago, but my mind has blanked since then. Are there any good guides that talk about advanced tooling like genmake and compiling multiple directories / namespaces worth of code?
    Alan Justino da Silva
    @alanjds
    Hi, @wthorp. What you mean by "multiple directories"? After all the tooling installing, handling of multiple Python modules (including subfolders) is automatic.
    You may want to pass -v debug flag to grumpy to see where and how stuff is going:
    grumpy -v debug run myfile.py