News for hackers. Stuff that matters.
Re:Ask HN: What Happened to Borland? by codr7 on Friday December 10, 2021 @01:14PM (#29513380)
Death by bean counting and enterprise bs, that's what happened.

I spent 13 years writing Object Pascal in Delphi full time, starting from Delphi 4 and ending right about where Embarcadero entered the scene.

They seriously dropped the ball by focusing on ticking enterprise boxes and charging insane amounts for it rather than evolving and fixing stuff.

Re:Ask HN: What Happened to Borland? by ccleve on Friday December 10, 2021 @01:33PM (#29513640)
Exactly this.

Pascal was a great language, and I wonder how much we've lost by having it go by the wayside. It was strongly-typed, easy to read, cross-platform, produced native executables, and was lightning fast to compile and execute.

I say "was" a great language because it isn't widely used today. I miss it.

Re:Ask HN: What Happened to Borland? by qalmakka on Friday December 10, 2021 @01:36PM (#29513688)
Also it had sane strings. Strings with sizes, withouth the whole null-terminated madness of C which still haunts us nowadays.
Re:Ask HN: What Happened to Borland? by pjmlp on Friday December 10, 2021 @03:48PM (#29515272)
Languages 10 years older than C have proper strings, in a certain sense there are some design decisions common to Go and C, regarding adoption of common features.
Re:Ask HN: What Happened to Borland? by masklinn on Friday December 10, 2021 @05:27PM (#29516211)
> Also it had sane strings. Strings with sizes

Except they were prefixes on the buffer which was bad and not sane, and greatly limited the size of the original pascal strings.

And technically they were UCSD strings, not standard pascal, and other implementations used e.g. padded strings.

Re:Ask HN: What Happened to Borland? by jstimpfle on Friday December 10, 2021 @01:57PM (#29513945)
"Sane" strings that may waste 4 bytes of length field for unnecessary count, or may have a 1 or 2 bytes length field that proves to be insufficient. Or "sane" strings that alloc and dealloc and refcount like mad, bringing the application to a stall. "Sane" strings that discourage the developer from just coming up with a simple memory management scheme that fits the situation at hand.

"Sane" strings that lead to incredible bloat and incompatibility, because there is no one true "sane" string type, so every module that doesn't know better forces their own way onto the user.

Re:Ask HN: What Happened to Borland? by Jtsummers on Friday December 10, 2021 @02:19PM (#29514235)
If the length field is 4 bytes then only 3 bytes are "wasted" compared to C with its null-terminated strings and 1-byte chars. The difference drops if you have wider character types. Not to mention the time saved not having to scan every string to determine its length.

I always find it weird when people fret about bytes but not cycles, especially cycles that have to be spent waiting for memory reads.

Re:Ask HN: What Happened to Borland? by yongjik on Friday December 10, 2021 @03:27PM (#29515066)
You are thinking as a developer in 2020s, not one in 1990s (or earlier). Memory was incredibly precious: 16-bit x86 had 64KB segments, so if your data didn't fit in, it would be a lot slower. People used nibbles (4 bits) because the extra instructions dealing with bit twiddling was worth the cost.

Basically, no sane programmer in the 90s would be happy with a string type that wasted three bytes per object.

Re:Ask HN: What Happened to Borland? by masklinn on Saturday December 11, 2021 @07:47AM (#29520516)
I think one of the other factors (I fear calling it "mitigating") is that fixed-width strings were a lot more common back in the days. Outside of serialization they're pretty much gone now, but we can see their mark in various oddball "string" functions of the C standard library which were never designed to operate on "C strings" (though strings.h also has a lot of functions which are just plain garbage with no redeeming features).

For instance strncmp and (especially) strncpy make very little sense with C strings, but make sense for NUL-padded strings.

Re:Ask HN: What Happened to Borland? by Jtsummers on Friday December 10, 2021 @03:30PM (#29515097)
CPU cycles were also incredibly precious. It's a tradeoff. In the 80s and 90s you also had smaller caches so iterating over a string to determine its length was more expensive (more likely to hit RAM) than "just" reading its length parameter and carrying on with your life.
Re:Ask HN: What Happened to Borland? by yongjik on Friday December 10, 2021 @04:34PM (#29515720)
Sure everything was more expensive, but not by the same factor. Main memory was smaller but also relatively faster compared to CPU. Search for "386 simm memory" and you'll see 60ns modules. Considering that 386 debuted with 12MHz clock, 60 ns is faster than one CPU clock cycle!

In other words, "reading the whole string from memory" could be a performance problem, but a less serious problem for machines of those days, compared to using a few more bytes to store the length.

Re:Ask HN: What Happened to Borland? by fiedzia on Friday December 10, 2021 @06:57PM (#29516970)
> Basically, no sane programmer in the 90s would be happy with a string type that wasted three bytes per object.

In general, maybe, but we are talking about Borland here, so business logic apps mostly. String size is not a problem there.

Re:Ask HN: What Happened to Borland? by musicale on Monday December 13, 2021 @01:42AM (#29537341)
> Basically, no sane programmer in the 90s would be happy with a string type that wasted three bytes per object.

Though it was eventually eclipsed by C/C++/Objective-C on Apple platforms, I believe Pascal was the original application programming language for the Apple Lisa and Macintosh, and produced some revolutionary software in the 1980s.

Object Pascal/Delphi certainly enjoyed a fair amount of success in the 1990s.

Re:Ask HN: What Happened to Borland? by pjmlp on Friday December 10, 2021 @03:50PM (#29515283)
Yet JOVIAL, NEWP, PL/I, PL/S, PL.8 among other Algol dialects managed it.
Re:Ask HN: What Happened to Borland? by inkyoto on Friday December 10, 2021 @10:08PM (#29518041)
> JOVIAL, NEWP, PL/I, PL/S, PL.8 among other Algol dialects managed it.

… with all of them having been developed and run on 32-bit IBM mainframes and other big irons with «lots» of memory (e.g. 512 kB of RAM would have been considered huge in early 70-s).

C, on the other hand, was developed with limitations of early PDP-11's in mind that were often equipped with 56kB of RAM, so null-terminated strings in C was a rationalised design decision and/or a trade-off. Besides, both, UNIX and C started out as a research and a professional hobby project, not a fully fledged commercial product.

Since the internetworking had been inexistent slightly less than entirely, remote code execution that stemmed from buffer overruns was not an issue, either.

Re:Ask HN: What Happened to Borland? by pjmlp on Saturday December 11, 2021 @01:48AM (#29519036)
You can start with IBM 704 used for Fortran and Lisp in 1954, TT 465L Strategic Air Command Control System in 1960, B5000 in 1961, CDC 6600 in 1964, and then compare with the capabilities from a 1964 PDP-7.

Read the DoD security assessment on Multics, https://multicians.org/b2.html

Afterwards you can read from Denis' own words,

> Although we entertained occasional thoughts about implementing one of the major languages of the time like Fortran, PL/I, or Algol 68, such a project seemed hopelessly large for our resources: much simpler and smaller tools were called for. All these languages influenced our work, but it was more fun to do things on our own.

Taken from https://www.bell-labs.com/usr/dmr/www/chist.html

So thanks to their fun, the world now suffers from C strings.

Re:Ask HN: What Happened to Borland? by inkyoto on Saturday December 11, 2021 @01:03PM (#29522885)
> Although we entertained occasional thoughts about implementing one of the major languages of the time like Fortran, PL/I, or Algol 68, such a project seemed hopelessly large for our resources: much simpler and smaller tools were called for […]

Precisely my point. The definition of fun is up for a personal interpretation.

Re:Ask HN: What Happened to Borland? by jstimpfle on Friday December 10, 2021 @03:41PM (#29515205)
Scanning for the string length (e.g strlen()) is asymptotically worse than reading a fixed size integer, so obviously don't do that unless it's a good memory/speed tradeoff (i.e. when you know the string is at most say, 16 bytes long).

Overall, it seems you didn't read my comment either. Or was I _that_ unclear?

Re:Ask HN: What Happened to Borland? by nwiswell on Friday December 10, 2021 @02:03PM (#29514036)
Obviously C-style strings can still remain an option where they are needed, but in most cases using the 4 bytes for a length field is a sane default. How many buffer overflow attacks have been enabled by that four byte savings over the years?

> "Sane" strings that discourage the developer from just coming up with a simple memory management scheme that fits the situation at hand.

"Sane" compilers that discourage the developer from considering the machine level instructions. It's turtles all the way down.

There's a reason that Python is so popular and it's not performance

Re:Ask HN: What Happened to Borland? by jstimpfle on Friday December 10, 2021 @03:18PM (#29514982)
This is not Python so that's a strawman.
Re:Ask HN: What Happened to Borland? by nwiswell on Friday December 10, 2021 @03:55PM (#29515351)
By that I meant that there is obviously value in abstracting away tasks and details that the programmer would otherwise need to manage. That is why compilers exist. The value-add for abstracting a string is certainly more than the cost of 4 bytes of memory in the typical case.

Put another way: optimizing the management of strings in memory is almost never the best use of time to make progress toward an organization's objectives, and doubly so when that kind of micro-tuning can actually introduce security risks

Re:Ask HN: What Happened to Borland? by mdip on Friday December 10, 2021 @02:22PM (#29514291)
This never, ever bit me in the Pascal days. I suspect this was primarily because the stack I was using was either "provided by the Borland Pascal standard library" pieces, or it was my own Pascal or assembler code.

I had a limited number of calls into a library and a need to do a few things that escape me with regard to interacting with -- I think -- an 16550 UART[0] and its driver, but I don't recall them being particularly nasty to deal with. I mean, all things relative -- I was expecting these to be nasty to deal with because they often involved inline assembler, so the problem of "making it behave with the string" wasn't quite as pressing as "what the hell am I actually doing here?" :)

[0] My huge project was a bulletin board system in the 90s.

Re:Ask HN: What Happened to Borland? by nerdponx on Friday December 10, 2021 @02:07PM (#29514070)
I hardly consider four bytes to track the length of a string "waste".

I also don't really know why you assume that "sane" means "doesn't let you manage memory effectively".

That said, how many applications really are bottlenecked by string processing in the first place? I don't care if processing Unicode graphemes is slow, as long as it's correct and doesn't mangle users' names.

Re:Ask HN: What Happened to Borland? by jstimpfle on Friday December 10, 2021 @03:27PM (#29515061)
Well I for one optimized an authorization module of an enterprise application written in Delphi by getting rid of standard library strings. Speedups where 100x-1000x, accelerating application startup time from minutes to maybe 3 seconds.
Re:Ask HN: What Happened to Borland? by novok on Friday December 10, 2021 @02:36PM (#29514458)
He is probably thinking about the context of the 1980s, when a large amount of 3 byte waste (the 1 byte null char is a form of 'waste' itself) might have been a problem back then.
Re:Ask HN: What Happened to Borland? by jstimpfle on Friday December 10, 2021 @03:28PM (#29515072)
Packed structs with char fields of 8 bytes or so are still common.
Re:Ask HN: What Happened to Borland? by adrianmsmith on Saturday December 11, 2021 @06:28AM (#29520118)
I don't know the details but I doubt that 4 bytes would be used for a length of a string in the 90s. 2 bytes would lead to 64k characters which is surely more than you'd need for the average string.

And surely if you malloc(..) a block of memory in C and store a string in it, the memory allocation system is going to store how large a block that is anyway (even if it isn't visible to either C or Pascal probably.) I know not all strings will be malloc'd but a lot will be. And we seemed to deal with this overhead fine in the 90s?

Re:Ask HN: What Happened to Borland? by jstimpfle on Saturday December 11, 2021 @10:19AM (#29521423)
That you have to weigh 2 vs. 4 byte lengths is exactly making my point. There is also a case for 1 byte lengths, and for string implementations other than length + pointer, like for example rope datastructure implementations. My point is that there is not one sensible string implementation, and acting like there was is in many situations trading short term convenience for long term pains in larger projects.

> I know not all strings will be malloc'd but a lot will be. And we seemed to deal with this overhead fine in the 90s?

It's a common but deeply flawed assumption that allocations and lifetimes are so random that every little object should be individually allocated and later deallocated with malloc()/free() or with another generic allocator. I don't use malloc() to allocate string buffers - except in rare situtations of laziness, knowing it will come back to bite me later. Not only performance concerns but also the practical impossibility of matching each malloc() with a free() forbids that. Systems like RAII come to help to solve the latter issue, but I prefer to take the difficulty of matching everything up as an indication that the general approach is too complicated.

Instead I recommend to allocate strings using a fixed field (eg. char buf[16]) on a stack frame, or using a member in a struct, in order not to add any management overhead. Alternatively, for unbounded and dynamically sized strings, it's often a good idea to allocate them using linear allocators. For example, in a GUI renderer, it's a good idea to have a per-frame allocator that collects all allocations in a list of larger chunks, to minimize the allocation overhead to a few chunks (KBs to MBs) that were individually allocated from the system. With this, everything is freed using a single central function call after the frame was renderered and the data is now not needed any longer.

Re:Ask HN: What Happened to Borland? by kaba0 on Friday December 10, 2021 @02:56PM (#29514732)
How is iterating over the string each time you want to do anything meaningful better? Also, there is a short string optimization, where you can store the string inside the pointer , eg. c++ does just that.
Re:Ask HN: What Happened to Borland? by jstimpfle on Friday December 10, 2021 @03:20PM (#29514994)
You didn't read my comment right. My statement is there isn't one true string type. I didn't say you shouldn't use a length field.

Zero terminated strings still make some sense of course - ease of reading when looking at byte level representation, and moderate cost savings in packed structs (4, 8, or 16 byte strings). The former is why I zero terminate by default where possible, even when using a separate length field stored somewhere else (almost always).

Re:Ask HN: What Happened to Borland? by johnfn on Friday December 10, 2021 @02:11PM (#29514130)
The thing is, not every developer wants to care about memory management. A lot of us just want to solve user problems, and we don’t mind too much if we spend a couple of extra bytes to do so.
Re:Ask HN: What Happened to Borland? by jstimpfle on Friday December 10, 2021 @03:31PM (#29515115)
It's not primarily about the bytes. Heap allocating RAII style strings can absolutely kill performance. And they are baaaad for modularity. It's all in my OP, why do I even repeat?
Re:Ask HN: What Happened to Borland? by teeray on Friday December 10, 2021 @01:57PM (#29513953)
> strongly-typed, easy to read, cross-platform, produced native executables, and was lightning fast to compile and execute.

Sounds like Go

Re:Ask HN: What Happened to Borland? by doodpants on Friday December 10, 2021 @02:32PM (#29514421)
Except that Go is for command line programs and backend code; its standard library doesn't include a cross-platform GUI API for desktop applications.
Re:Ask HN: What Happened to Borland? by zamadatix on Friday December 10, 2021 @02:55PM (#29514725)
What was the stdlib's cross platform GUI like in Pascal?
Re:Ask HN: What Happened to Borland? by codr7 on Friday December 10, 2021 @03:13PM (#29514924)
Probably could have been awesome, the Windows flavor certainly was; but they dropped Kylix before it got a chance to go anywhere.
Re:Ask HN: What Happened to Borland? by Tozen on Friday December 10, 2021 @09:00PM (#29517703)
You might want to look at Delphi's VLC and FireMonkey. With Free Pascal/Lazarus, they have the LCL (open source equivalent to VLC).

Free Pascal/Lazarus has no problem with Linux or macOS. It was Delphi that stumbled around for some years about this, but presently can also be installed now on both. Of course, Delphi cost the big bucks.

Re:Ask HN: What Happened to Borland? by CRConrad on Sunday December 12, 2021 @05:27PM (#29534335)
VCL, not VLC. Visual Component Library.
Re:Ask HN: What Happened to Borland? by Tozen on Monday December 13, 2021 @02:30AM (#29537555)
LOL, you are right, such a silly typo. I was actually playing around with VLC player at that time, so must have got "crossed wires".
Re:Ask HN: What Happened to Borland? by CRConrad on Tuesday December 14, 2021 @06:27AM (#29550518)
I usually get it wrong the other way around in stead.
Re:Ask HN: What Happened to Borland? by thriftwy on Friday December 10, 2021 @03:06PM (#29514850)
On the other hand, it was verbose, and most of original Pascal ideas were unsound and replaced in Object Pascal with ones coming from C.

"Break loop" being a function rather than keyword is serious PHP land.

It had better OO than C++, though. I admit it, they managed to have a sane and compact statically checked compilable OO.

Re:Ask HN: What Happened to Borland? by Tozen on Saturday December 11, 2021 @12:02AM (#29518576)
Seems like you are a bit mistaken, as Object Pascal borrowed very little from C, nor did it need to. Object Pascal is just an extension of Pascal. Objects and Classes are just another type, just like Records. The relationship between Pascal and Object Pascal is extremely close, far more than say between C and C++. Which is why many get confused, thinking there is such a similar gap.

OO in Object Pascal is a lot more sane than in C++, because the concept of an Object was more aligned to the existing Record type. It would be something like taking C and empowering its structs with methods. There wasn't an attempt to make radical changes, but simply extend the language with OO. Where with C++, in comparison to C, much more fundamental changes were made that created more conflicts in how the languages are used.

Re:Ask HN: What Happened to Borland? by visarga on Saturday December 11, 2021 @12:51AM (#29518806)
I used Pascal between 1992 and 2000, one thing I missed a lot was dynamic lists and dictionaries. It was so hard to develop everything with pointers and allocations, so fragile.
Re:Ask HN: What Happened to Borland? by pjmlp on Friday December 10, 2021 @03:46PM (#29515251)
At least in Germany it is still used enough to have a presence on some magazines, and there is an yearly conference.
Re:Ask HN: What Happened to Borland? by speed_spread on Friday December 10, 2021 @01:27PM (#29513556)
Yep, they brutally tried to trade community goodwill for enterpris-ey contracts and quickly lost both.
Re:Ask HN: What Happened to Borland? by vrodic on Friday December 10, 2021 @01:29PM (#29513592)
I was under the impression that a lot of the original team was hired by MS and that was the end of Borland that created Delphi.
Re:Ask HN: What Happened to Borland? by pantulis on Friday December 10, 2021 @01:28PM (#29513572)
I mean, they even had their own CORBA broker!
Re:Ask HN: What Happened to Borland? by stickfigure on Friday December 10, 2021 @01:37PM (#29513694)
Unpopular opinion: CORBA was underrated. For its time, CORBA was a decent way of stitching together heterogeneous systems. Tediously hand-coding REST APIs was a big step backwards, and gRPC is really just catching up to where we were before.
Re:Ask HN: What Happened to Borland? by scrumper on Friday December 10, 2021 @02:12PM (#29514145)
I remember learning about CORBA in undergrad too. Then a few months into my first job, "new guy, go do this integration with SOAP/WSDL." Crushed me so hard I went into sales.
Re:Ask HN: What Happened to Borland? by AnotherGoodName on Friday December 10, 2021 @02:40PM (#29514533)
The 'never again' part of working with soap for me was that Microsofts and Javas soap libraries were more or less incompatible for a variety of reasons.

I could handle the xml madness but at least make sure the standard is a standard.

I'm pretty happy with rest apis on that front. I can always make them work.

Re:Ask HN: What Happened to Borland? by pjmlp on Friday December 10, 2021 @03:52PM (#29515321)
Yeah I remember those happy days.

There were some configuration behaviours on the standard that had opposite defaults.

Re:Ask HN: What Happened to Borland? by atombender on Friday December 10, 2021 @05:50PM (#29516447)
And there's Cap'n Proto, which is essentially a reinvention of CORBA.

Unlike gRPC, where RPC calls are just functions that take pure data arguments and return pure data structs, Cap'n Proto allows RPCs to return references to objects. The client can hold onto the reference and call methods on it, which invoke RPC calls, while the client and server runtimes keep track of what the references refer to. So you can treat remote objects as if they're local to your process.

This "location transparency" feature is at the heart of CORBA, and later, Microsoft DCOM and Java RMI. I've never used Cap'n Proto, but with CORBA/DCOM/RMI, this is a really powerful feature which allows you to work with APIs as if they're just in-process libraries. The downside is that if you pretend there's no network overhead, you might end up designing very inefficient applications, with each method call becoming a network roundtrip. It also means a client can, if you're not careful, "hog" a remote object and keep it from being deallocated, resulting in leaks or excessive memory usage.

Basic DCE-style RPC like gRPC is simpler and has more predictable performance, since you're forced to consider that you're talking to a remote API, just like REST.

Re:Ask HN: What Happened to Borland? by codr7 on Sunday December 12, 2021 @06:43PM (#29534898)
Having worked with some of those; I'm going to say thanks, but no thanks.

Hiding network access and pretending it's all local is a recipe for disaster.

If you're writing a networked application, that's right up there on the list of things you need to focus on and never forget.

Re:Ask HN: What Happened to Borland? by poulsbohemian on Friday December 10, 2021 @02:00PM (#29513985)
Thank you!! I did my undergrad thesis around CORBA (showing my age…) and you are spot on that the whole world proceeded to pile on a whole lot of work in order to make everything run over http.
Re:Ask HN: What Happened to Borland? by pjmlp on Friday December 10, 2021 @03:53PM (#29515333)
Agreed, but unfortunately so is fashion in this industry.
Re:Ask HN: What Happened to Borland? by Tozen on Friday December 10, 2021 @08:52PM (#29517657)
The Pascal community has to be thankful for the creation of the open source project of Free Pascal/Lazarus and to a degree the Russian created PascalABC. There are some others, but these are ones still here and viable. The open source Object Pascal projects is was kept the language alive.

Delphi/Embarcadero went all out chasing enterprise dollars. The prices they charge burns holes in pockets for any little guys. Only in the last few years have they come to their senses with the free Community Edition and focusing again on making school/academic licenses easier to get and more accessible.

Re:Ask HN: What Happened to Borland? by appleflaxen on Friday December 10, 2021 @01:53PM (#29513897)
Embarcadero was a version of Delphi?

I googled it, but it wasn't clear if it was a buy-out, a rebrand, or something else.

Re:Ask HN: What Happened to Borland? by jstimpfle on Friday December 10, 2021 @02:00PM (#29513993)
from wikipedia, "On May 7, 2008 Borland Software Corporation announced that its software development tools division, CodeGear, was to be sold to Embarcadero Technologies for an expected $23 million price and $7 million in CodeGear accounts receivables retained by Borland.[5] The acquisition closed on June 30, 2008 for approximately $24.5 million.[6]"