1. Re: Link to current IDE for 4.1?

ghaberek said...

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.

new topic     » goto parent     » topic index » view message » categorize

2. Re: Link to current IDE for 4.1?

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

new topic     » goto parent     » topic index » view message » categorize

3. Re: Link to current IDE for 4.1?

ChrisB said...

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 

....

new topic     » goto parent     » topic index » view message » categorize

4. Re: Link to current IDE for 4.1?

ghaberek said...

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.

new topic     » goto parent     » topic index » view message » categorize

5. Re: Link to current IDE for 4.1?

jimcbrown said...

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.

jimcbrown said...

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

new topic     » goto parent     » topic index » view message » categorize

6. Re: Link to current IDE for 4.1?

ghaberek said...

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.

ghaberek said...

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.

new topic     » goto parent     » topic index » view message » categorize

7. Re: Link to current IDE for 4.1?

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 
new topic     » goto parent     » topic index » view message » categorize

8. Development of memstruct

Forked from Re: Link to current IDE for 4.1?

Icy_Viking said...

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

new topic     » topic index » view message » categorize

9. Re: Development of memstruct

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. getlost

-Greg

new topic     » goto parent     » topic index » view message » categorize

10. Re: Link to current IDE for 4.1?

Icy_Viking said...

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

new topic     » goto parent     » topic index » view message » categorize

11. Re: Link to current IDE for 4.1?

ghaberek said...
Icy_Viking said...

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.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu