4 ms·
what makes me skeptical is this "Generic raw pointers are not supported". The goal of C type languages are to offer performance not ease of use. So if that mean
by kilon 13y ago
what makes me skeptical is this "Generic raw pointers are not supported". The goal of C type languages are to offer performance not ease of use. So if that means loss of performance kinda defends the purpose. And if I want ease of use I rather use Pharo . But I support the effort, and I am certainly very interested to see what will come out of this :)
- pjmlp 13y agoThe thing is that it is possible to have both, like the Pascal branch of languages proves. Or if Apple had kept investing into Dylan, for example.
- kilon 13y agoyes definitely , I am not saying its not possible. Afterall Objective C itself supports manual memory management and GC . I was just wondering if Objective Smalltalk has something similar.
- Dewie 13y ago> The thing is that it is possible to have both, like the Pascal branch of languages proves. Do you recommend any particular languages for this purpose, nowadays?
- pjmlp 13y agoIt is a bit hard to recommend any besides Ada. Thanks to Ada Core, the issue with Ada compilers costing a small fortune is no nonlonger true. Given its support for Ada compiler in GCC. At least in Europe, Ada seems to be having an increase in usage, specially in areas where human lifes are at risk. I don't have a real measure for that, just by watching how Ada presence has been growing at FOSDEM. For remaining Modula, Oberon and Pascal dialects, there is no industry support any longer, except a few niche places.
- mpweiher 13y agoAn 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.