Search found 396 matches

by stijn
Tue Jan 21, 2020 7:20 pm
Forum: General Discussion and Questions
Topic: Garbage Collection Not Working
Replies: 10
Views: 236

Re: Garbage Collection Not Working

In principle it doesn't matter if you call gc_collect via Python or C, that should both do the same. But note each port has it's own implementation of gc_collect and that should work properly else results might not be ok.
by stijn
Tue Jan 21, 2020 4:27 pm
Forum: General Discussion and Questions
Topic: Garbage Collection Not Working
Replies: 10
Views: 236

Re: Garbage Collection Not Working

528 bytes left still means the memory for c was reclaimed otherwise much more would be left, no? The rest can be memory from the parser or so, pretty hard to tell without logging everything which is on the heap. Btw if I just run this from a file the result is different: import gc def Test(): try: c...
by stijn
Tue Jan 21, 2020 12:40 pm
Forum: General Discussion and Questions
Topic: Garbage Collection Not Working
Replies: 10
Views: 236

Re: Garbage Collection Not Working

Is there a way to 'kill' or force the script to go out of scope Yes (couple of ways, e.g. wrap the whole thing in a function and execute the function instead of using global scope), but also make sure that is really what you want? I mean: you allow a user to execute multiple statements consecutivel...
by stijn
Tue Jan 21, 2020 9:14 am
Forum: General Discussion and Questions
Topic: Garbage Collection Not Working
Replies: 10
Views: 236

Re: Garbage Collection Not Working

execute the script. Then its still idle I assume this means you use execute_from_lexer or similar? Would really help to see actual code here, or at least some pseudocode showing what goes on (for starters: where does the GC call occur?). But in any case it's most likely as tve says: assigning a var...
by stijn
Sat Jan 18, 2020 8:37 am
Forum: General Discussion and Questions
Topic: Combo of a C and python module?
Replies: 6
Views: 601

Re: Combo of a C and python module?

Hiding "_thread" might be OK? If it's configurable and off by default, otherwise: please no. Having those modules visible and available for use can be really helpful for debugging plus in the end they're just modules like all others. Treating them consistently is an advantage and the path of the le...
by stijn
Fri Jan 17, 2020 9:20 am
Forum: General Discussion and Questions
Topic: Heap Usage
Replies: 1
Views: 186

Re: Heap Usage

There's a bunch of functions in the micropython modules showing memory usage: >>> import micropython >>> dir(micropython) ['__class__', '__name__', 'const', 'heap_lock', 'heap_unlock', 'kbd_intr', 'mem_current', 'mem_info', 'mem_peak', 'mem_total', 'opt_level', 'pystack_use', 'qstr_info', 'stack_use...
by stijn
Wed Jan 15, 2020 8:44 am
Forum: General Discussion and Questions
Topic: Is EtherCAT possible to port to micropython?
Replies: 1
Views: 200

Re: Is EtherCAT possible to port to micropython?

Since that source builds on a variety of platforms already, the principle of porting is relatively easy (add some hardware-specific code possibly, build, wrap public API in MicroPython module) and I'm fairly sure it is going to work, but it's hard to estimate how much work it is since the API is fai...
by stijn
Mon Jan 13, 2020 8:40 am
Forum: General Discussion and Questions
Topic: Target audience for MicroPython?
Replies: 63
Views: 4812

Re: Target audience for MicroPython?

There are only limited amounts of time and money which can be spent on development, so allocating part of that for something of which it is completely unclear whether there is and will be enough interest for is tricky. I mean, you're the first person raising the issue here, and there's many other ar...
by stijn
Sat Jan 11, 2020 8:30 am
Forum: General Discussion and Questions
Topic: Libraries used in Micropython
Replies: 4
Views: 229

Re: Libraries used in Micropython

__name__ -- urandom That's what is going on: you have imported the urandom module, not the random module from micropython-lib. Meaning the latter is not found in the module search path, and as a result MicroPython checks if the module doesn't happen to have a 'micro implementation' i.e. a module wi...
by stijn
Fri Jan 03, 2020 7:20 pm
Forum: General Discussion and Questions
Topic: Would a pyboard purchase support the project?
Replies: 14
Views: 709

Re: Would a pyboard purchase support the project?

If the pyboard store was selling raspberry pi zero's with micropython already installed, Damien's revenue might increase by a factor of 10, or 100. Why? Because the hurdle to attach hardware would effectively disappear. Not sure that would really work out: MicroPython is open source so people can j...