2 ms·
An important point. ObjST does offer different variations of the concept of a "pointer". The first is a ref:. This is a reference to a resources, so a genera
by mpweiher 13y ago
An important point.
ObjST does offer different variations of the concept of a "pointer". The first is a ref:. This is a reference to a resources, so a generalization of what a pointer is. Specific scheme providers can return refs that are effectively pointers, so for example a reference to the name of a person:
nameRef := ref:var:person/name
This eliminates the need for string-based techniques such as Key-Value-Coding (KVC), for example when binding user-interface elements. A text-field can just take a ref, and manipulate that:
nameRef value:'Pascal'.
This will set the name of the person to 'Pascal'.
A ref:file: is a reference to a file. Storing that in another file creates a symbolic link:
file:linktohome <- ref:file:{env:HOME}
In addition, scheme providers are extensible. So for example if you need to access a hardware register at a specific address, you could have a mem: scheme provider:
mem:0x10f := 23.
Assuming you have the correct permissions :-)
In terms of performance, that is often better provided by bulk collections. Pointer indirections are actually a major drain on processor performance these days.
So the broad idea is to provide performance via bulk primitives, hardware access via scheme-providers and aliases/references via first class references ('ref:'). "Generic raw pointers" should then be largely unnecessary, specific pointers can be provided as necessary.
- kilon 13y agoah nice , similar to what I expected. Its also very nice to see a new way of doing things. I will have to look more deeply into your implementation. I really hope you keep up with this and not abandon it. I would love to have an objective C alternative. Is there support "out of the box" for obj c libraries , or wrappers will be needed to do so ? I see you support the to: message for loops, is there also a do: message for iterations ? I really prefer it instead of for loops :) I see the syntax really looks like smalltalk and that for me is a huge plus compared to Objective C, well done and as I said I really hope you keep working on this. I am definitely going to try it :)
- mpweiher 13y ago"obj c libraries" Any library in the image can be accessed via messaging without wrappers, that's the "peer" idea. C functions currently have to be wrapped, one of the reasons I did an Objective-C wrapper for CoreGraphics: https://github.com/mpw/MPWDrawingContext https://github.com/mpw/MPWDrawingContext The REPL / command-line script interpreter also has a convenience method for loading frameworks, so `context loadFramework:'AppKit' will load the AppKit and also parse the scripting-bridge definitions so you have access to constants. Combined with the ability to drop back into the REPL, this has made it possible for me to trivially create custom shell, for example pdfsh <filename> loads a PDF into memory and then drops me at the command prompt with an object representing the PDF bound to the variable `pdf`. "iteration" Most normal Smalltalk collection/block iteration protocol is supported, so #to:do: is just shorthand for first #to: , creating an Interval, and then #do: iterating that interval. In addition to the ones taking a block argument, you also get the equivalent ones taking a message.
- kilon 13y agovery well done. Its seems you have created something that has a lot of potential. Being able to use obj c libraries out of the box and yet use smalltalk syntax is a huge win for me. I only hope the best for your project :)