Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, 7th_zorro, ozgur, Quad), 841 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 5 of 6 1 2 3 4 5 6
Re: Lite Foundation - A powerful Lite-C library [Re: WretchedSid] #371007
05/17/11 09:45
05/17/11 09:45
Joined: Mar 2002
Posts: 1,774
Magdeburg
F
FlorianP Offline
Serious User
FlorianP  Offline
Serious User
F

Joined: Mar 2002
Posts: 1,774
Magdeburg
Okay...at first I was wondering why i didnt post here already as this seemed pretty familiar, but then it came back to me...

I gotta say - I'm sorry - in advance; i usually don't like people bitching about manuals if they dont understand it, but...
your documentation is total crap.
It has several grammatical mistakes, uses _really_ unusual vocabulary, doesnt seem to have any strcture, jumps from informal crap ("It does exactly what it says;" and afterwards you tell me what it really does?) to complete jibberish ("This is useful to provide one way to achieve a result, without knowing the targets." ????) - its just written awfully.
f.i.
Quote:
Returns the string and delegating its ownerhship to the caller.
! This forbidden as the function signals that it doesn't delegate the
! ownership to the caller!

delegate? ownership? What the...!!??

...the doxygen is fine...

Alright...sorry for the little outburst - and to the point:
I think I can finally grasp the concept and I gotta say - I really like the idea. Nevertheless I just dont know why to use it as it is now. I got to work with (visual) c++ anyway...also beacuse theres just no way to do a serious project in SED.
Also i dont get why someone who writes in C and needs classes would use LiteFoundation instead of C++ (or objective-c) as it seems to be pretty invasive not really worth the effort (but maybe thats just me)

Something like a pre-compiler that lets you write C++ syntax (classes, inheritance and stuff...) and translates it into Lite-C would be cool...dunno if someone already did this or if its even possible - just an idea that might get some more feedback

so long


I <3 LINQ
Re: Lite Foundation - A powerful Lite-C library [Re: FlorianP] #371010
05/17/11 10:20
05/17/11 10:20
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline OP
Expert
WretchedSid  Offline OP
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Originally Posted By: FlorianP

your documentation is total crap.
It has several grammatical mistakes, uses _really_ unusual vocabulary, doesnt seem to have any strcture, jumps from informal crap[...]

Yup yup and yup. The problem is, it follows an structure. The thing is, the getting started guide is to tell people how things are meant to be. I can't throw a huge bunch of code at people and say "hey, learn it!".
This is why the informal "crap" is there, it is meant to tell you the naming conventions, memory conventions and all this stuff. Plus the global concept of Lite Foundation, how things work in general etc. pp.
This knowledge is supposed to give you an advantage, because it sets a default way for how things work and saves you from trips to the reference just to look what the function does or what kind of object it returns.

Its not really easy to explain all this stuff and looking at the rest of your post it looks like you didn't tried to understand it (or you just failed because of my grammar). I will try to write it better, and this is also why I asked for feedback (without, I can't improve it).

Originally Posted By: FlorianP

Quote:
Returns the string and delegating its ownerhship to the caller.
! This forbidden as the function signals that it doesn't delegate the
! ownership to the caller!

delegate? ownership? What the...!!??

What the "ownership" is, is described in broad detail in the chapter before your quoted line. And I really hope that you don't count "delegate" to the unusual vocabulary, because it isn't unusual. In Deutschland würden wir übrigens "delegieren" dazu sagen.
"Es ist verboten die ownership an den caller zu delegieren weil der Funktionsname signalisiert das genau das nicht passiert."


Originally Posted By: FlorianP

Nevertheless I just dont know why to use it as it is now. I got to work with (visual) c++ anyway...also beacuse theres just no way to do a serious project in SED.

Yes, but it is possible do a serious project in LED. Beside that, I don't want you to use Lite Foundation just because I think its cool. If you like C++, C#, ObjC or whatever more than C, feel free to use it.
But I have discussed this already two times in this thread and a third time isn't needed. Just read my response to eg. ratchet, I have discussed it there and then letter in response to Uhrwerk again.

Quote:
Also i dont get why someone who writes in C and needs classes would use LiteFoundation instead of C++ (or objective-c) as it seems to be pretty invasive not really worth the effort (but maybe thats just me)

Again, this has been already discussed two times here. Its not just the concept of classes that makes Lite Foundation what it is.

Quote:
Something like a pre-compiler that lets you write C++ syntax (classes, inheritance and stuff...) and translates it into Lite-C would be cool...dunno if someone already did this or if its even possible - just an idea that might get some more feedback

Probably, but I hate C++ (yes, its that simple)


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: Lite Foundation - A powerful Lite-C library [Re: WretchedSid] #371022
05/17/11 11:05
05/17/11 11:05
Joined: Mar 2002
Posts: 1,774
Magdeburg
F
FlorianP Offline
Serious User
FlorianP  Offline
Serious User
F

Joined: Mar 2002
Posts: 1,774
Magdeburg
Originally Posted By: JustSid
The problem is, it follows an structure.


Hum? I couldnt find any structure but way too long sentences.
I think it was Goethe who once wrote something like this to a local duke - 'I'm sorry my letter is that long but i couldnt find the time to make it shorter'
My point: The shorter the better.

Originally Posted By: JustSid

The thing is, the getting started guide is to tell people how things are meant to be.


If I read a 'getting started' I want to get started and not be told why I should use Lite-Foundation in the first place.
("Now you might come up with the question: Why all the hassle?" - No i wont...)

Originally Posted By: JustSid

I can't throw a huge bunch of code at people and say "hey, learn it!".
This is why the informal "crap" is there, it is meant to tell you the naming conventions, memory conventions and all this stuff. Plus the global concept of Lite Foundation, how things work in general etc. pp.
This knowledge is supposed to give you an advantage, because it sets a default way for how things work and saves you from trips to the reference just to look what the function does or what kind of object it returns.


Then maybe call it 'All about Lite-Foundation' not 'Getting started'.

Originally Posted By: JustSid

Its not really easy to explain all this stuff and looking at the rest of your post it looks like you didn't tried to understand it


Ye well I tried to _get started_ and got already lost on the first page.

Originally Posted By: JustSid
this is also why I asked for feedback (without, I can't improve it).


I consider this to be productive feedback.

Originally Posted By: JustSid
Yes, but it is possible do a serious project in LED.


Whats LED?


So my advice is - write a real 'Getting started'. Theres way too much information thats supposed to be in a Manual or a 'reading further'
You can shorten it by half (well almost^^) only if you cut out all the
"Lite Foundation needs to trick a little bit;"
"surprise"
"Now you might come up with the question: Why all the hassle? Why not just use structs
and ship a few functions with them and everything is just fine?"
"Now thats all fine, but it leads
to a few problems: The main question is: When do I have to free what?"
“Hey, I&#700;m interested in this object, please keep it alive”
“Alright, thanks for keeping the object alive, but I don&#700;t
need it anymore” (informal crap aleart^^)
"You probably have already noticed it"
...and on and on...
These sentences either contain none information at all or could be said in 3 words max.


I hope this might help you interest some more people in Lite Foundation - Im pretty sure this is a main reason why 'nobody gets it'.
I also have some more suggestions for your documentation if youre interested pm me or so.


I <3 LINQ
Re: Lite Foundation - A powerful Lite-C library [Re: FlorianP] #371048
05/17/11 15:57
05/17/11 15:57
Joined: Dec 2008
Posts: 1,218
Germany
Rackscha Offline
Serious User
Rackscha  Offline
Serious User

Joined: Dec 2008
Posts: 1,218
Germany
@FlorianP: i have some first simple conceptional notes here for a PreCompiler.
Thought about it for some time now. Hopefully i have some time todo a simple prototype during the next week(this one is already full>.<).

My goal is to provide a precompiler that can process a class, an reconstructs it as a struct with function bindings, being able to derive from another class.

Precompiler automatically constructs the base constructor of the class(which includes the function binding).

LATER support for This/Self yet. This needs a second step, going through the whole code and adding new parameters to the medthos(an autoadded parameter).

Classes will be plased in .class files(easier for me to just go through the classfile instead of going through the whole project, maybe screwing womething up. LAter maybe in normal cfiles). class files are precomputed to c files, and collected in a file called Classes.c. This should be the only file the user has to include.

Thats my concept, already wrote a simple parsing systems at work for another purpose. Lets see.

Greetings
Rackscha



Last edited by Rackscha; 05/17/11 15:58.

MY Website with news of my projects:
(for example my current
Muliplayer Bomberman,
GenesisPrecompiler for LiteC
and TileMaster, an easy to use Tile editor)
Sparetime-Development

Re: Lite Foundation - A powerful Lite-C library [Re: Rackscha] #372189
05/29/11 21:16
05/29/11 21:16
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline OP
Expert
WretchedSid  Offline OP
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Wow, the next Lite Foundation release is here. And it is totally awesome, I'm really excited!

Just to get you started right away, here is the download link:
http://cl.ly/7Btf

And now about the new features:
The first new feature is of course multithreading, this gives you three new classes: LFThreadRef, LFLockRef, LFConditionRef. Now the sad part: Lite-C users will certainly have crashes when using the multithreaded Lite Foundation. Why? Because of the tricks I had to use to get Lite Foundation running, it uses a lot of global variables and function pointers. There is no way around this and it makes no sense to introduce a big lock because I can't handle everything on the Lite Foundation level.
I'm sorry and will certainly file a lot of feature requests!

But, there are way more exciting features. Lets start with a really useful one: Zombies.
Zombies is a operating mode of the runtime, in this mode the runtime won't purge objects from memory but let there bodies leak intentionally. Why? For a good reason: It will log EVERY access you make to the death object! So you can be sure that you can track over releasing of objects and using of deallocated objects as fast as possible.
The runtime will log the function that caused the problem, the objects class and the objects pointer, enough to give you an idea where the problem is. This is incredible useful for beginners new to the Lite Foundations memory model.

Here is an actual example and the output in the console:
Code:
LFRuntimeSetZombieLevel(kLFZombieLevelScribble); // Enable zombies
	
LFStringRef string = LFStringWithCString("Hello"); // Create a new, autoreleased string
LFRelease(string); // Release the string. This will deallocate the string because we are the only owner

LFStringAppendCString(string, "World"); // Do something bad!



This piece of code will log:
Code:
Sent LFStringAppendCString to already deallocated instance <LFString 0x1005b0>
Sent LFRelease to already deallocated instance <LFString 0x1005b0>


Pretty cool, hu?


More cool stuff? Oh yea, remember the first Lite Foundation version? It had a LFDateRef class and to be honest it sucked. One couldn't do any math with it and it couldn't represent fractions of seconds.
Now Lite Foundation knows again a LFDateRef object. Together with its buddies LFDateComponentsRef and LFTimeZoneRef, it is crazy powerful. And I mean really crazy powerful!
LFDateRef just wraps the time in seconds and sub-miliseconds since 1st January 2001. LFDateComponentsRef can get the single components (days, hours, etc) from a LFDateRef plus it can calculate with them. The difference between my birth and today in minutes? No problem, just two lines of code!
LFTimeZoneRef is an abstract wrapper for a time zone (currently no daylight saving time support, sorry). It holds an offset to GMT in seconds, thats it.

Here is an actual example:
Code:
// This function prints the minutes and hours passed since Lite Foundations release
// Lite Foundation was released on 19/04/2011 03:27 CET
void printTimeSinceLFRelease()
{
	LFDateComponentsRef components = LFDateComponentsCreate(2011, 04, 19, 3, 27, 0.0); // Create a new LFDateComponentsRef containing the date of the Lite Foundation release
	LFTimeZoneRef timeZone = LFTimeZoneCreateWithAbbreviation(LFSTR("CET")); // The thread was created in the central europe time zone
	
	LFDateRef releaseDate = LFDateComponentsGetDate(components, timeZone);
	LFDateRef currentDate = LFDateCreate(); // Grab the current date
	
	
	LFDateComponentsRef difference = LFDateComponentsGetDifferenceFromDates(currentDate, releaseDate, timeZone, kLFHoursComponent | kLFMinutesComponent); // Get the hours and minutes passed since the release
	// For simplicity we use the same time zone (CET) again, but you can interchange the time zone with yours to get the time since the post and the current date in your time zone
	
	printf("%i hours and %i minutes passed since the inital Lite Foundation release!", difference->hour, difference->minute);
	
	// Cleanup
	LFRelease(components);
	LFRelease(timeZone);
	LFRelease(currentDate);
}


All time function respect leap years and all the such and are really crazy powerful and useful. The download folder contains an example.

With working dates object, one could also revive the LFTimer class, right? Right! There is a new LFTimer class, it allows firing in the sub-milisecond range, or in an hour. Or at a specific date.

There is a lot of other stuff, but I guess I have already mentioned the most awesome stuff. Like I said, I'm really, really excited about this release and I hope you like it.

@FlorainP: Sorry, there is no new getting started guide in this release. But I'm working on it! If you don't mind, I will send you a draft via PN so you can say something about it?

Edit: Fun fact; The line count of this release is almost twice as large as the one from the previous release. 12333 vs 6402 lines.

Last edited by JustSid; 05/29/11 23:16.

Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: Lite Foundation - A powerful Lite-C library [Re: WretchedSid] #372190
05/29/11 21:53
05/29/11 21:53
Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
Quad Online
Senior Expert
Quad  Online
Senior Expert

Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
I did not really took a deep look in lite foundation yet, but retain count thing alone is a reason for me to use it. (that comes from objective-c if i am not mistaken?)

Next time(not soon) i start something with lite-c i am definitely going to use it.

Last edited by Quadraxas; 05/29/11 21:54.

3333333333
Re: Lite Foundation - A powerful Lite-C library [Re: Quad] #372192
05/29/11 22:11
05/29/11 22:11
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline OP
Expert
WretchedSid  Offline OP
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Yay, awesome laugh

Originally Posted By: Quadraxas
that comes from objective-c if i am not mistaken?

Not really. ObjC by itself isn't an reference counting environment, but Foundation is. This is, everything that inherits from NSObject is automatically part of the reference counting environment and usually if one programs something for OS X or iOS, everything inherits von NSObject.
But its not only ObjC, many other languages also have the concept of an reference counting environment, eg. boost:: shared_ptr (afair its also in the tr1 namespace and C++0x has its in its default library).

Anyway, if you are familiar with Foundation, you will also be familiar with Lite Foundation. I tried to be very near to Foundation because I work with it every day (although the name Lite Foundation doesn't imply that its a Foundation spin off). There are also different concepts that I don't like in Foundation, but you will see what I mean if you are familiar with it.


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: Lite Foundation - A powerful Lite-C library [Re: WretchedSid] #372194
05/29/11 22:22
05/29/11 22:22
Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
Quad Online
Senior Expert
Quad  Online
Senior Expert

Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
Yeah, i only used obj-c with foundation so far(enterprise survey app with lots of features for ipad for a company/internal use.), my mistake.

I did not like(did not hate either) obj-c except for some neat features like retain counting etc... Personally liked android approach for screens more.(written same app for android too.)

maybe i just did not fully understand it... maybe.

Last edited by Quadraxas; 05/29/11 22:22.

3333333333
Re: Lite Foundation - A powerful Lite-C library [Re: Quad] #372195
05/29/11 22:31
05/29/11 22:31
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline OP
Expert
WretchedSid  Offline OP
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Mh, you mix up the language and its frameworks a lot here. For example, UIKit (the high level screen rendering stuff framework) is not part of Foundation.
What most people hate about ObjC is the [] stuff, but I personally like it a lot because it makes nested function calls way easier to read.


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: Lite Foundation - A powerful Lite-C library [Re: WretchedSid] #372196
05/29/11 22:43
05/29/11 22:43
Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
Quad Online
Senior Expert
Quad  Online
Senior Expert

Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
yeah, by saying obj-c, i generally refer to objc+foundation+uikit(ios development platform as a whole).


3333333333
Page 5 of 6 1 2 3 4 5 6

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1