[fpc-pascal] Generics vs templates
I was talking with a c++ developer who explained how templates are implemented in c++ and how use some recursive method which causes them to totally murder compile times. This isn’t the first I’ve heard of the problem though and I recall some game studios who develop engines in c++ saying they are strictly off limits for the same reasons. Having just started to use generics in FPC myself I was curious if FPC suffers from the same problem of slow compile times? Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Register Allocation on x86_64
On 07/01/18 23:24, Martok wrote: Am 05.01.2018 um 18:03 schrieb Jonas Maebe: regvars have always been disabled for routines that contain assembler blocks (on all architectures). Sometimes the compiler temporarily uses registers for other purposes over a longer period, which is why marking the used registers is still required. I can see that this is safer if the assembler blocks aren't properly annotated, but if they are, there shouldn't be any problem? Part of it is probably legacy, and part of it is the philosophy that the compiler does not try to understand assembly blocks and hence cannot make any assumptions about what is and what is not safe regarding local variables in the same routine. Unlike in e.g. gcc, there are no annotations for assembly routines that they expect certain variables to be in memory and/or registers, that the block may touch arbitrary memory locations, etc. Hence, the compiler is as conservative as possible. It is probably possible to safely increase the code quality of routines containing assembly blocks, but that would require a proper examination of what optimizations are safe under which conditions (and it would lead to the need to add support for extra annotations for assembly blocks). There seem to be a lot of rather non-obvious limitations around inline assembler and assembler routines. Are they documented somewhere central? Afaik there are only two limitations: * routines containing assembly blocks (including pure assembly routines) cannot be inlined * regular procedures that contain assembly blocks will never use regvars Jonas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] re-engineering tool
On Sat, 2018-01-06 at 18:01 +0100, Marco van de Voort wrote: > In our previous episode, Marc Santhoff said: > > Since I'm confronted with the task of analyzing a pile of object > > pascal > > sources I'd like to know: > > > > Is there any tool that can help me? > > I've used Peganza's pascal analyser in the past, for D7 code. I > haven't > used it in a while though. I'll have a look at it, thanky you! Marc -- Marc Santhoff___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] First pas2js public release
On 07.01.2018 15:03, Ingemar Ragnemalm wrote: > and here is an (almost) fully working snake game: > > http://ragnemalm.se/images/santa/snake/snake.html > Perhaps you should write somewhere how the snake is controlled. I personally am used to using all four cursor keys to control the snake's movement based on the global coordinate system instead of only left and right from the local coordinate system on the snake. So I was quite confused at first as I used "Up", but the snake didn't move there... ^^' Regards, Sven ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] fpc-pascal Digest, Vol 163, Issue 11
I've done it, let's call it "santa3", it's amazing! :-) [you've made my day] For the last point: yes! Sandro p.s.: look at the attachment. On 7 January 2018 at 18:56, Ingemar Ragnemalmwrote: > > Thanks! The limitations in the sound playing are straight from > JavaScript's Audio API. I think I know how to loop a sound, although the > online advice are pretty confusing. For playing a sound multiple times, it > seems I need to load it multiple times! Not very elegant but it can be done. > > The last point, is that when turning twice very fast? > > /Ingemar > > > Den 2018-01-07 kl. 16:38, skrev Sandro Cumerlato: > >> Awesame work!:-) >> >> areas for improvement: >> >> in santa2 >> - loop Jingle Bells.mp3 for an infinite pleasure;-) >> - play boing.mp3 multiple times in case of multiple keyboard hits. >> >> in snake: >> - avoid this:https://imagebin.ca/v/3nOH4webezqH >> > > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal santa3.pas Description: Binary data ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] fpc-pascal Digest, Vol 163, Issue 11
Thanks! The limitations in the sound playing are straight from JavaScript's Audio API. I think I know how to loop a sound, although the online advice are pretty confusing. For playing a sound multiple times, it seems I need to load it multiple times! Not very elegant but it can be done. The last point, is that when turning twice very fast? /Ingemar Den 2018-01-07 kl. 16:38, skrev Sandro Cumerlato: Awesame work!:-) areas for improvement: in santa2 - loop Jingle Bells.mp3 for an infinite pleasure;-) - play boing.mp3 multiple times in case of multiple keyboard hits. in snake: - avoid this:https://imagebin.ca/v/3nOH4webezqH ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] First pas2js public release
Awesame work! :-) areas for improvement: in santa2 - loop Jingle Bells.mp3 for an infinite pleasure ;-) - play boing.mp3 multiple times in case of multiple keyboard hits. in snake: - avoid this: https://imagebin.ca/v/3nOH4webezqH On 7 January 2018 at 15:03, Ingemar Ragnemalmwrote: > > An update on my tests with pas2js: > > I have overcome most problems now and am quite a bit happier with what I > see - and what I did see before was good! > > Reimar Grabowski asked for interactivity. Done! > > Myself, I wanted to reduce the amount of information, like file references > in the HTML file, because, yes, it does matter! And I wanted to load > sounds, and of course I, too, wanted interactivity! Done! Adding missing > methods, interfacing to more APIs (like audio), no problem! It was > surprisingly easy. > > Here is an updated version of the Santa animation: > > http://ragnemalm.se/images/santa/santa2.html > > and here is an (almost) fully working snake game: > > http://ragnemalm.se/images/santa/snake/snake.html > > I really enjoyed making these! My code gets more and more comfortable, > there is no problem hiding the JS libraries. Will I do that in the long > run? Well, I don't know but doing that can help me making the code portable. > > I also made some minor additions to Lightweight IDE, so now I edit, > compile and run directly from the IDE. "Run" passes the HTML to a web > browser. > > I have implemented a different way to run animations, but still don't know > if it flickers on other platforms. On my Mac, there is no flicker at all. > > For gaming and similar purposes, all I miss now is the ability to save > scores on file. For a wider range of applications, I want the ability to > download data to my local drive. I havn't considered the case of > communicating directly with some server. > > For being a preliminary "0." version, pas2js works wonderfully well! > > /Ingemar > > > Den 2017-12-24 kl. 12:00, skrev Ingemar Ragnemalm: > >> Den 2017-12-22 kl. 12:00, skrev Michael Van Canneyt: >> >>> On Wed, 20 Dec 2017, Reimar Grabowski wrote: >>> >>> On Wed, 20 Dec 2017 15:14:50 +0100 Ingemar Ragnemalm wrote: But I don't see anything wrong with putting them in the HTML. For more flexibility you could create the HTML via a template engine or something but I would only load them from JS if there is a good reason to do so. >>> One reason is to collect information in one place. Making HTML load it >> gives me two steps to the file instead of one. More chances to do it >> wrong. >> >> While you are updating your code you can remove the two dependencies on bootstrap (as they are not satisfied anyway and I think the whole fpReport dir is superflous) and perhaps do something about the flickering of the text (although this may be a little bit too much asked). >>> Ah. They just remained from an example I worked from. >> >> Text flicker is most likely caused by not double buffering. I need to >> generate an image off-screen. Nothing strange with that, just one more >> thing to figure out in the JS environment. >> >> It feels really nice to have my first Pascal web application running! > Not dissing you or your work or pas2js but I fail to see the web application part. There is no communication between client and server. Actually there is no server side code at all and there is no interactivity. In my book this is a static page, but perhaps I miss something. >>> There is no interactivity, and no client-server communication, but this >> is my *first*, my "proof of concept" for the platform, like Hello World but >> with some more features (animation, random numbers, graphics elements). >> Doing *something* with it myself, showing myself the potential, making a >> kind of "thanks" for it and a Christmas greeting atthe same time. >> Interactivity is the next step, and the ability to save data somewhere. >> >> That is one of the points of pas2js. To allow you to program the browser. >>> >>> There is no need for a server. You can make e.g. a chess application >>> that runs >>> 100% in the browser, using a single HTML file. You can embed the JS and >>> images in the HTML itself, and thus your HTML file is the 'executable'. >>> >>> See the browser as a desktop. Your program runs in that desktop. >>> If need be, this program can contact a server - the classical >>> client/server model, using HTTP as the protocol - but this is by no >>> means a necessity. >>> >>> In that sense, the demo demonstrates this. The server is just there for >>> you >>> to be able to download the "program"... >>> >> Exactly. I get a cross-platform solution with no installations, in a way >> that users are increasingly used to. And I can write it in FPC, which I >> am a lot more happy with than a rubbish language like JavaScript! For me >> it opens a lot of possibilities! >> >> But let me get back to my current problems. I can
Re: [fpc-pascal] Error when trying to make tests for target AVR
On Sun, 2018-01-07 at 11:30 +0100, Florian Klaempfl wrote: > Am 07.01.2018 um 06:12 schrieb Christo: > > > > On Sun, 2018-01-07 at 05:59 +0200, Christo wrote: > > > > > > __missing_command_FPCMAKE -p -Tavr-embedded Makefile.fpc > > Adding fpc_baseinfo to the make command revealed that FPCMAKE was not > > defined (I guess it > > should > > have been obvious from the error message in the first place). I added the > > path to fpcmake > > (FPCMAKE=path_to_fpcmake) to the make command line and the tests are now > > running. > Do you have an fpcmake somewhere in your path? No, I uninstalled fpc and run from compiled source. At some point I had version conflicts when building trunk and now I run everything from the fpc source folder. The downside is that sometimes utilities aren't where they are expected, like in this case. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] First pas2js public release
An update on my tests with pas2js: I have overcome most problems now and am quite a bit happier with what I see - and what I did see before was good! Reimar Grabowski asked for interactivity. Done! Myself, I wanted to reduce the amount of information, like file references in the HTML file, because, yes, it does matter! And I wanted to load sounds, and of course I, too, wanted interactivity! Done! Adding missing methods, interfacing to more APIs (like audio), no problem! It was surprisingly easy. Here is an updated version of the Santa animation: http://ragnemalm.se/images/santa/santa2.html and here is an (almost) fully working snake game: http://ragnemalm.se/images/santa/snake/snake.html I really enjoyed making these! My code gets more and more comfortable, there is no problem hiding the JS libraries. Will I do that in the long run? Well, I don't know but doing that can help me making the code portable. I also made some minor additions to Lightweight IDE, so now I edit, compile and run directly from the IDE. "Run" passes the HTML to a web browser. I have implemented a different way to run animations, but still don't know if it flickers on other platforms. On my Mac, there is no flicker at all. For gaming and similar purposes, all I miss now is the ability to save scores on file. For a wider range of applications, I want the ability to download data to my local drive. I havn't considered the case of communicating directly with some server. For being a preliminary "0." version, pas2js works wonderfully well! /Ingemar Den 2017-12-24 kl. 12:00, skrev Ingemar Ragnemalm: Den 2017-12-22 kl. 12:00, skrev Michael Van Canneyt: On Wed, 20 Dec 2017, Reimar Grabowski wrote: On Wed, 20 Dec 2017 15:14:50 +0100 Ingemar Ragnemalmwrote: But I don't see anything wrong with putting them in the HTML. For more flexibility you could create the HTML via a template engine or something but I would only load them from JS if there is a good reason to do so. One reason is to collect information in one place. Making HTML load it gives me two steps to the file instead of one. More chances to do it wrong. While you are updating your code you can remove the two dependencies on bootstrap (as they are not satisfied anyway and I think the whole fpReport dir is superflous) and perhaps do something about the flickering of the text (although this may be a little bit too much asked). Ah. They just remained from an example I worked from. Text flicker is most likely caused by not double buffering. I need to generate an image off-screen. Nothing strange with that, just one more thing to figure out in the JS environment. It feels really nice to have my first Pascal web application running! Not dissing you or your work or pas2js but I fail to see the web application part. There is no communication between client and server. Actually there is no server side code at all and there is no interactivity. In my book this is a static page, but perhaps I miss something. There is no interactivity, and no client-server communication, but this is my *first*, my "proof of concept" for the platform, like Hello World but with some more features (animation, random numbers, graphics elements). Doing *something* with it myself, showing myself the potential, making a kind of "thanks" for it and a Christmas greeting atthe same time. Interactivity is the next step, and the ability to save data somewhere. That is one of the points of pas2js. To allow you to program the browser. There is no need for a server. You can make e.g. a chess application that runs 100% in the browser, using a single HTML file. You can embed the JS and images in the HTML itself, and thus your HTML file is the 'executable'. See the browser as a desktop. Your program runs in that desktop. If need be, this program can contact a server - the classical client/server model, using HTTP as the protocol - but this is by no means a necessity. In that sense, the demo demonstrates this. The server is just there for you to be able to download the "program"... Exactly. I get a cross-platform solution with no installations, in a way that users are increasingly used to. And I can write it in FPC, which I am a lot more happy with than a rubbish language like JavaScript! For me it opens a lot of possibilities! But let me get back to my current problems. I can accept loading images through HTML for now, but how can I load and play sounds? There is an "Audio" API in JavaScript but it seems that pas2js doesn't support it, it can't find play(). I have searched web.pas and a few others for it. Where do I start to fix that? /Ingemar ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] String message methods and the self parameter
On 06/01/18 17:35, Sven Barth via fpc-pascal wrote: > Judging from the implementation inside the RTL I'd say that this is a > bug in the documentation. String message methods work like ordinal > ones and take only one parameter. Yes, that is what it seems like. So once upon a time this feature was present, probably while the syntax was still "data: pointer" instead of "var data"? Anyway, I'll file a bug against the documentation in a couple of days or so. -- Ewald ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Error when trying to make tests for target AVR
Am 07.01.2018 um 06:12 schrieb Christo: > On Sun, 2018-01-07 at 05:59 +0200, Christo wrote: >> __missing_command_FPCMAKE -p -Tavr-embedded Makefile.fpc > > Adding fpc_baseinfo to the make command revealed that FPCMAKE was not defined > (I guess it should > have been obvious from the error message in the first place). I added the > path to fpcmake > (FPCMAKE=path_to_fpcmake) to the make command line and the tests are now > running. Do you have an fpcmake somewhere in your path? ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal