Adding Java and C++ to the MQTT benchmarks or: How I Learned to Stop Worrying and Love the Garbage Collector
H. S. Teoh
hsteoh at quickfur.ath.cx
Thu Jan 9 11:28:56 PST 2014
On Thu, Jan 09, 2014 at 08:16:12PM +0100, Paulo Pinto wrote:
> Am 09.01.2014 19:34, schrieb Walter Bright:
> >On 1/9/2014 10:18 AM, "Ola Fosheim Grøstad"
> ><ola.fosheim.grostad+dlang at gmail.com>" wrote:
> >>On Thursday, 9 January 2014 at 17:15:46 UTC, Walter Bright wrote:
> >>>How does that work when you pass it "hello"? allocated with
> >>>malloc()? basically any data that has mixed ancestry?
> >>
> >>Why would you do that? You would have to overload cat then.
> >
> >So you agree that it won't work.
> >
> >BTW, it happens all the time when dealing with strings. For example,
> >dealing with filenames, file extensions, and paths. Components can
> >come from the command line, string literals, malloc, slices, etc.,
> >all mixed up together.
> >
> >Overloading doesn't work because a string literal and a string
> >allocated by something else have the same type.
> >
> >
> >>>That doesn't work if you're passing strings with mixed ancestry.
> >>
> >>Well, you have to decide if you want to roll your own, use a
> >>framework or use the old C way.
> >>
> >>The point is more: you can make your own and make it C-compatible,
> >>and reasonably efficient.
> >
> >My point is you can't avoid making the extra copies without GC in any
> >reasonable way.
> >
>
> Every time I see such discussions, it reminds me when I started
> coding in the mid-80s and the heresy of using languages like Pascal
> and C dialects for microcomputers, instead of coding everything in
> Assembly or Forth.
>
> :)
[...]
Ah, the good ole 80's. I remember I was strongly pro-assembly in those
days. Back then compiler / interpreter technology was still rather
young, and the little that I saw of it didn't leave a good impression,
so I regarded all high-level languages with suspicion. :) Especially
languages that sport "nice" string operators, since back then many
language implementations had rather naïve string implementations, which
are really slow and inefficient.
T
--
Always remember that you are unique. Just like everybody else. -- despair.com
More information about the Digitalmars-d
mailing list