L0laapk3 / FactorioMaps

L0laapk3's FactorioMaps mod
https://mods.factorio.com/mod/L0laapk3_FactorioMaps
Other
119 stars 22 forks source link

Factorio isn't killed on posix systems #37

Closed OvermindDL1 closed 5 years ago

OvermindDL1 commented 5 years ago

It seems the process kill call is incorrect.

L0laapk3 commented 5 years ago

Problem lies with the fact that on posix the pid of the main process isnt the original pid anymore when it was created, I don't know how to solve this for now. One solution could be to just kill all factorio instances but I want to avoid that.

fbartho commented 5 years ago

I'm also exhibiting this issue.

To get the script to launch at all, I had to comment out this line: https://github.com/L0laapk3/FactorioMaps/blob/master/auto.py#L604

It was executing instantly, and then crashing because "pid" was not defined.

OvermindDL1 commented 5 years ago

@fbartho I have a fork of this project that I need to PR back in to it that gets it working on linux well about 70% of the time, there seems to be a race condition or something. I really badly want to rewrite the python code (either in python or in bash or something, or maybe just rust so it will run everywhere)... ^.^;

fbartho commented 5 years ago

@OvermindDL1 Haha, neat! I used to love python, but stopped actively writing anything in it 5 or 7 years back. I hear that Python has stronger type annotations nowadays, a strongly typed Python would be fine.

My personal day-to-day is TypeScript/JS, with some native code. Any strongly typed language is easier to drop in-out of as open source (in-my-opinion) than totally untyped code. :P Also, strongly typed languages make refactors fantastically easier to deal with.

Rust feels too much like C++ for me to have done more than scan over the syntax so far 😉. I find TypeScript pretty forgiving + it has easy ability to interop with looser code -- I introduced my team to it a year ago when we migrated some fully native java/objc apps to react-native and it's gaining traction in my company. Most of my day-to-day shell scripts are TypeScript these days.

Also fun options: https://sorbet.org (Ruby Type Checker, coming to the stdlib this year!)

(Sorry for the noise!)

OvermindDL1 commented 5 years ago

Haha, neat! I used to love python, but stopped actively writing anything in it 5 or 7 years back. I hear that Python has stronger type annotations nowadays, a strongly typed Python would be fine.

There's an optional static type checker though it's a fairly basic system. For python-like things I tend to do OCaml instead (I basically use ocaml like it's a better python, I only grab python if I need one of its specific libraries otherwise), and it is a significantly better language. ^.^

My personal day-to-day is TypeScript/JS, with some native code. Any strongly typed language is easier to drop in-out of as open source (in-my-opinion) than totally untyped code. :P Also, strongly typed languages make refactors fantastically easier to deal with.

All too true!

Rust feels too much like C++ for me to have done more than scan over the syntax so far wink

Eh not really, Rust is more like a faster lower-level haskell with worse syntax... ^.^;

It's speed is on par with C++, but the 'language' is definitely more like haskell with linear types and the syntax is... a weird amalgamation.

I find TypeScript pretty forgiving + it has easy ability to interop with looser code -- I introduced my team to it a year ago when we migrated some fully native java/objc apps to react-native and it's gaining traction in my company. Most of my day-to-day shell scripts are TypeScript these days.

I find typescript just a poor bandage over javascript and too many of javascript's warts come through, I'd opt for OCaml (or ReasonML if you like a javascript'y syntax) over typescript as it can compile to javascript.

Here's a live ocaml->javascript in the browser if you are curious: https://bucklescript.github.io/bucklescript-playground/

It is literally the OCaml compiler, which is written in OCaml, compiled to javascript and run in the browser, and it still compiles as you type (it's one of the fastest optimizing compilers out). ^.^

Ruby... is a horrible language... >.>