1. Re: Link to current IDE for 4.1?
- Posted by petelomax Feb 17, 2020
- 1848 views
If anyone is interested in helping, there are a several "TODO" sections in c_struct.e that need to be completed: https://github.com/OpenEuphoria/euphoria/blob/struct/source/c_struct.e
This prevents translated code from accessing nested memstruct or memunion members, which is admittedly a rather fringe use case, but should be supported nonetheless.
To state the bleedin' obvious, there are 8 cases, so the first thing I would do (my C is very rusty) is add 8 fatal error messages, rebuild, then create a test set that triggers all 8.
2. Re: Link to current IDE for 4.1?
- Posted by ChrisB (moderator) Feb 17, 2020
- 1809 views
Hi Pete
Never any harm in stating the bleedin' obvious to numpties like me! I went to the university of the bleedin obvious, and still don't have a degree.
So, at the risk of being roasted in EuFire, what are the 8 cases?
Cheers
Chris
3. Re: Link to current IDE for 4.1?
- Posted by petelomax Feb 17, 2020
- 1809 views
So, at the risk of being roasted in EuFire, what are the 8 cases?
Four times this:
case MEMUNION then -- TODO case MEMSTRUCT then -- TODO
....
4. Re: Link to current IDE for 4.1?
- Posted by jimcbrown (admin) Feb 18, 2020
- 1779 views
This prevents translated code from accessing nested memstruct or memunion members, which is admittedly a rather fringe use case,
IMVHO, not really. At least no more than having memstruct/memunion in OE at all. Structs and unions are quite common in C code and it would be quite odd to have support in interpreted code, but not translated (-to-C) code. I recall a handful of libraires (older versions of EuGTK, PeteE's pthreads wrapper, etc) needed a C shim to get around the lack of support in Eu.
5. Re: Link to current IDE for 4.1?
- Posted by ghaberek (admin) Feb 19, 2020
- 1753 views
IMVHO, not really. At least no more than having memstruct/memunion in OE at all. Structs and unions are quite common in C code and it would be quite odd to have support in interpreted code, but not translated (-to-C) code.
I don't think this is a blocker for all memstruct/memunion in translated code as a whole, just nested memstruct/memunion. The code to peek/poke simple struct members (basically floats and ints) is already there.
I recall a handful of libraires (older versions of EuGTK, PeteE's pthreads wrapper, etc) needed a C shim to get around the lack of support in Eu.
Another feature we need to focus on is passing and returning structs by value to C routines, to eliminate the need for shims. I just had to add several shim functions to libharu in order to pass some pointers in and out.
-Greg
6. Re: Link to current IDE for 4.1?
- Posted by jimcbrown (admin) Feb 20, 2020
- 1698 views
I don't think this is a blocker for all memstruct/memunion in translated code as a whole, just nested memstruct/memunion. The code to peek/poke simple struct members (basically floats and ints) is already there.
Ahhh I get it now.
Another feature we need to focus on is passing and returning structs by value to C routines, to eliminate the need for shims. I just had to add several shim functions to libharu in order to pass some pointers in and out.
-Greg
Agreed. That'd be majorly beneficial.
7. Re: Link to current IDE for 4.1?
- Posted by Icy_Viking Feb 21, 2020
- 1568 views
I looked at the TODO for the memstruct. I saw where code is needed, I'm just not sure what is needed. I'm probably beating a dead horse here, but I still think a simple struct method would be nice too. Something like,
struct my_struct atom x,y,w,h end struct my_struct.x = 10 --access it like this
8. Development of memstruct
- Posted by ghaberek (admin) Feb 16, 2020
- 1584 views
- Last edited Feb 22, 2020
Forked from Re: Link to current IDE for 4.1?
Getting memstruct finished and implemented would be great. It would also be a great help for wrapping C libraries as well.
If anyone is interested in helping, there are a several "TODO" sections in c_struct.e that need to be completed: https://github.com/OpenEuphoria/euphoria/blob/struct/source/c_struct.e
This prevents translated code from accessing nested memstruct or memunion members, which is admittedly a rather fringe use case, but should be supported nonetheless.
-Greg
9. Re: Development of memstruct
- Posted by ghaberek (admin) Feb 22, 2020
- 1508 views
I forked this into a new thread and moved the responses here. Having to do this via SQL queries reminds me how much I need to get a new site working.
-Greg
10. Re: Link to current IDE for 4.1?
- Posted by ghaberek (admin) Feb 22, 2020
- 1518 views
I looked at the TODO for the memstruct. I saw where code is needed, I'm just not sure what is needed. I'm probably beating a dead horse here, but I still think a simple struct method would be nice too. Something like,
struct my_struct atom x,y,w,h end struct my_struct.x = 10 --access it like this
I agree. However, as nice as this would be, memstruct currently isn't built to do this. I'm wondering if we should implement struct type along the lines of enum type.
-Greg
11. Re: Link to current IDE for 4.1?
- Posted by Icy_Viking Feb 22, 2020
- 1497 views
I looked at the TODO for the memstruct. I saw where code is needed, I'm just not sure what is needed. I'm probably beating a dead horse here, but I still think a simple struct method would be nice too. Something like,
struct my_struct atom x,y,w,h end struct my_struct.x = 10 --access it like this
I agree. However, as nice as this would be, memstruct currently isn't built to do this. I'm wondering if we should implement struct type along the lines of enum type.
-Greg
I'd be in favor of implementing a struct type like how there is a enum type.