Golang News http://golangnews.com Jobs, Code, Videos and News for Go hackers - everything about the go programming language Mon, 27 Mar 2017 06:33:00 +0000 Scripting go - embedding lua in go apps When video games are written, the game engine would be written in some low level language such as C or C++ to achieve the best performance. You would need to get direct access to the hardware and such languages are perfect for that. Building software in such languages requires good understanding of OS, memory management and just internals in general. To make game development more accessible, for instance to UI or level designers, we can introduce a scripting language that can hook into the core engine and perform some actions as the game state changes. The idea of scripting your core is amazing. 6 points posted by kenny http://vilkeliskis.com/articles/scripting-go-embedding-lua-in-go-apps 1988 Sat, 25 Mar 2017 00:01:00 +0000 Scripting Go: Putting Lua Behind Bars In the previous article I showed you how we can run lua scripts inside Go applications. In real world scenarios you'd want to put in more effort to make sure that we are guarded against rogue scripts. A rogue is a script that: Runs some commands that should not be allowed. Or it steals resources from the main application. For example, if we're allowing third parties to pass arbitrary scripts to our application, we may want to ensure that this script has no access to networking or system libraries. Another example of a malicious script, is a script that runs indefinitely. There could be an error in a loop causing the script to never finish. We may also want to ensure that we're having more control around how much memory can be allocated in the VM. These are the topics I am going to cover in this post. 4 points posted by tadasv http://vilkeliskis.com/articles/scripting-go-putting-lua-behind-bars 2017 Fri, 31 Mar 2017 01:14:00 +0000