Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : Popping the Gosub stack...
Page 3 of 3 | |||||
Author | Message | ||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 6100 |
Windows has lots of small(ish) sections of code, usually called the API, which higher level 'applications' call on as required. Provided the interface is not changed, Windows can be updated with changes to the base code and new functions added without causing existing applications to fail. More lines of code doesn't always mean more features or better code. MM Edit currently has 7500 lines of code but if I was to re-do it, I could reduce the count by a thousand or more lines. I am looking at changing the language I use to one that 'should' allow a Linux version and I have no idea what the line count will be for identical program features. Jim VK7JH MMedit MMBasic Help |
||||
Grogster Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 9308 |
Oh my God.... Well - enough said on that one! Smoke makes things work. When the smoke gets out, it stops! |
||||
vk2sja Newbie Joined: 07/06/2013 Location: AustraliaPosts: 26 |
Hi Jim, I'd be very interested in a Linux version of MMEdit. Which language are you currently using? Steve. |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 6100 |
Hi Jim, I'd be very interested in a Linux version of MMEdit. Which language are you currently using? Steve. MM Edit is written in Liberty Basic but with a lot of calls to the Windows API. I am looking at PureBasic which has compilers for Windows and Linux. This means that I cannot rely on the Windows API. PureBasic solves a few problems for me but I have a few different show-stoppers to sort out. If I can get a VT100 terminal up and running on Windows and Linux, I will continue with the conversion. Don't expect a working product in less than 12 months..... Jim VK7JH MMedit MMBasic Help |
||||
MicroBlocks Guru Joined: 12/05/2012 Location: ThailandPosts: 2209 |
A language you could use is C#. It has its counterpart on Linux called Mono. Also on Mac OS X http://www.mono-project.com/Mono:Linux You compiled code is binary compatible. C# is a very popular language, so if you choose another language it is a good candidate as many examples and libraries are available on internet. It is maybe no the easiest to change to but i would advice it to use instead of a VB.net as its syntax is just horrible and clumsy. Microblocks. Build with logic. |
||||
JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 3802 |
Yes, I wrote it all and no that doesn't include libraries (most of whose source code I don't have anyway). MS don't in fact fix API bugs quite a bit of the time as I found when part of their beta testing. They added the "justification": "this is a change by design" when it clearly was "we changed it, it's a stupid change that breaks existing code, tough". Will LibertyBasic not run under WINE? John |
||||
Dylan Regular Member Joined: 17/06/2013 Location: NetherlandsPosts: 81 |
No idea. Lazarus/FreePascal won't need Wine. I'll be the first to admit that Visual Basic came before Delphi/VCL (and a long time before Kylix). Java came at about the same time, and was "free" as in "crap". (Not that certain Object Pascal implementations of Delphi weren't crap). The closest modern equivalent to Basic is Python. https://code.google.com/p/python-on-a-chip/ would be nicer if it worked on pic32. All the more so for the difference between range and xrange in 2.x ;) |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 6100 |
Will LibertyBasic not run under WINE? John Yes, Liberty Basic applications can run well under Wine. The one area of grief for most users is getting the serial ports working. If I can come up with an 'easy to get going' Linux VT100 terminal for the Maximites, a lot of users will have a happier first time experience. Unfortunately, my Linux experiences are all from servers and I have had little to do with the graphical interfaces used today. I like a challenge.... Jim VK7JH MMedit MMBasic Help |
||||
vk2sja Newbie Joined: 07/06/2013 Location: AustraliaPosts: 26 |
Someone has done a port http://blog.flyingpic24.com/2012/05/15/32-bit-pic-programmin g-in-python/ |
||||
MicroBlocks Guru Joined: 12/05/2012 Location: ThailandPosts: 2209 |
I would seriously advice anyone learning a language to avoid python as the plague. It has some crazy ideas how it handles white space. The one who made that up should be shot in front of a crowd and then be torn apart by four horses. As you might have noticed i not really like python. :) All caused by the incredible stupid indentation rules. The times i had to fix indentation problems are countless. The reason, some use tabs and some uses spaces. If it would only allow tabs or only spaces as indentation all that trouble could have been prevented from the start. If you write code for your own, use tabs OR spaces otherwise you will be thinking you arrived in some twilight zone where nothing is working as it should. It also depends on your editor. I work with code from many different programmers and they all have their own 'style' and favorite editor. With any other language this indentation/whitespace is no worry at all and the only concern is correctness of the code. With python it is first about correctness of indentation, and then about the code. Microblocks. Build with logic. |
||||
Dylan Regular Member Joined: 17/06/2013 Location: NetherlandsPosts: 81 |
... The reason, some use tabs and some uses spaces. ... With python it is first about correctness of indentation, and then about the code. I have to admit I have not written a large python program yet. Nor do I intend to. In particular, I do not intend to copy-paste from multiple sources - so the tab/space issue is not an issue for me. However, I am proposing it as a first language to learn, specifically as the modern equivalent of basic, and why? Because the whole C family, including Java, allow using {...} to indicate blocks WITHOUT requiring them to be aligned in any way. I find Python human-readable (similar to Pascal in that respect), my editor has not yet caused me any tab/space issues, and although I've made the occasional mistake, having blocks aligned has made it easier, not harder. Which reminds me, I need to update my webserver. import SimpleHTTPServer
import SocketServer PORT = 8001 class MyHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): def do_GET(self): print self.path self.send_response(200) self.send_header("Content-type", "text/html") self.send_header("Content-length", 9) self.end_headers() self.wfile.write("It worked") Handler = MyHandler httpd = SocketServer.TCPServer(("", PORT), Handler) print "serving at port", PORT httpd.serve_forever() |
||||
MicroBlocks Guru Joined: 12/05/2012 Location: ThailandPosts: 2209 |
Nothing wrong with using indentation, only that most editors will not show you if they are tabs or spaces. Allow only one and there would be nor problems. If Python defined that only tabs could be used for indentation again none of the current problems would occur. It is plain and simple a very big mistake to base a language on indentation and then allow different kinds of indentation that can cause bugs that are extremely difficult to find because the human readable form looks correct. Only because a tab is used instead of 2 or 4 or 8 spaces whatever the editor configuration for tabs is. Imagine that the code sample you posted contained spaces and tabs and you asked if the code is good, because you tried it and it did not work. Then nobody can give a definite answer because the code looks good without errors. i prefer to read something like this: A webserver [code] var http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello World\n'); }).listen(1337, '127.0.0.1'); console.log('Server running at http://127.0.0.1:1337/'); [/code] NO change of reading that wrong. Although i prefer a little less dense: [code] var http = require('http'); var server = http.createServer(Webserver); server.listen(1337, '127.0.0.1'); console.log('Server running at http://127.0.0.1:1337/'); function Webserver(req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello World\n'); } [/code] Microblocks. Build with logic. |
||||
Grogster Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 9308 |
Well, I wouldn't say that..... But then, I am advanced at PICAXE, but only semi-advanced(more-or-less novice) at MMBASIC, and totally mystified by other code languages like that listed above. Smoke makes things work. When the smoke gets out, it stops! |
||||
Page 3 of 3 |
Print this page |