Page 1 of 1
Converting ANSI C to Hollywood?
Posted: Fri Sep 06, 2024 11:29 pm
by MarisaG1967
I'm working on converting some small ANSI C programs to Hollywood and was wondering if anyone has tips on doing this...
Re: Converting ANSI C to Hollywood?
Posted: Sat Sep 07, 2024 10:03 am
by Flinx
It's better to ask specific questions with code examples. It's almost impossible to answer this in such general terms.
Re: Converting ANSI C to Hollywood?
Posted: Mon Sep 09, 2024 5:50 am
by MarisaG1967
I don't have any code examples yet. I was just asking for tips on doing this in general.
Re: Converting ANSI C to Hollywood?
Posted: Mon Sep 09, 2024 9:38 am
by Flinx
Because the languages have very different levels of abstraction, we would need to know your level of knowledge for useful advice. The way you ask questions shows us how to answer.
A general tip: You need to understand how the program works in order to port it.
Re: Converting ANSI C to Hollywood?
Posted: Mon Sep 09, 2024 9:49 am
by MarisaG1967
I'm a experienced C programmer, but new to hollywood... I understand the original code and have done the reverse (other languages to C) but this is a new project for me.
Re: Converting ANSI C to Hollywood?
Posted: Tue Sep 10, 2024 7:37 pm
by airsoftsoftwair
The biggest problem is probably to deal with data types. Hollywood doesn't have data types whereas C has data types of different quantities (char, short, int...) and most of them are also available as signed and unsigned types. So when porting such code to Hollywood you have to take great care that it behaves exactly as in C. The
Cast() function can help here but even with that it can still be difficult to make sure the code behaves the same because in Hollywood all numeric values are basically 64-bit floating point values whereas C has a variety of data types and also distinguishes between signed and unsigned values.