TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Introducting C+

148 pointsby orangeduckover 12 years ago

20 comments

metaover 12 years ago
Cool idea.<p>I am confused by the implication of this code<p><pre><code> var prices = new(Table, String, Int); put(prices, $(String, "Apple"), $(Int, 12)); </code></pre> Stack objects are created with "$" so these are on the stack and then placed into the Table? So if this was in a function and the function returned, the Table (lets assume it was global) would now be pointing to destroyed stack variables? Is that the correct interpretation?<p>Is this all done with header files and the preprocessor? It looks like that is the case - if so, I am impressed at the dances you got it to do ;) Also, have you read <a href="http://www.amazon.com/Interfaces-Implementations-Techniques-Creating-Reusable/dp/0201498413/" rel="nofollow">http://www.amazon.com/Interfaces-Implementations-Techniques-...</a> which does some "Object Orientation" in C tricks?
评论 #4726417 未加载
troymcover 12 years ago
A resume that said the applicant had programmed with C, C+ and C++ used to be a tell. Not any more, I guess.
评论 #4727419 未加载
codewrightover 12 years ago
How is this different from Obj-C? Seems mostly like syntax sugar on top of what already exists in C.<p>The call and call_with are intriguing though.<p>Please change the name to something searchable and easily remembered before it's too late.
评论 #4725456 未加载
sverigeover 12 years ago
If only you had been around during my first interview when I told the recruiter that I knew C, C+, and C++.
jamesaguilarover 12 years ago
IMO, any new language that has inclusion as a mechanism for modules is not just at a developmental dead end, it's over the curb at the end of that dead end and in the retention pond beyond.<p>The parser and compiler should only need to examine each source file once.
评论 #4726475 未加载
评论 #4726679 未加载
nthitzover 12 years ago
You probably could have chosen a less confusing name..
评论 #4726824 未加载
评论 #4725449 未加载
michaelfeathersover 12 years ago
&#62; What I don't enjoy in Haskell is writing small detailed algorithms in a functional style.<p>Wow. That's my favorite part.
shadowmintover 12 years ago
Had a play with it; few oddities, but this is pretty cool.<p>The use of the $ function is totally not portable though, which is a bit of a pity.<p>Doesn't compile on a mac either; bunch of warning about pointer size that are being treated as errors by -Werror<p>Still, nice work~!
评论 #4726862 未加载
评论 #4725992 未加载
评论 #4727639 未加载
Meaiover 12 years ago
I have two things that would make me very happy in C: Overloadable operators and constructors/destructors. I have not been able to come up with a way to do that yet, but maybe if I change the entire way I write C like you did with the syntax changes, it might actually work. I'm going to have to think about that!
评论 #4726570 未加载
评论 #4726687 未加载
IsTomover 12 years ago
&#62; What I don't enjoy in Haskell is writing small detailed algorithms in a functional style.<p>You can hop around this easily using the ST monad. It's less elegant than usual Haskell and often less elegant than languages where mutation is 'native', but it does its job.
dysocoover 12 years ago
I dislike the way you declare variables, I'd rather prefer the classic: "int x = 5;" but with some syntactic sugar for Stack/Heap.<p>It's interesting anyways, I love the simplicity of C but agree that it's a bit "outdated", and I dislike the radical change of Go.
评论 #4725586 未加载
评论 #4725549 未加载
ryanashcraftover 12 years ago
I was working a similar project a few months ago. Wish I hade more time to complete. Mine was a bit more of a ripoff of Obj-C than anything. <a href="https://github.com/ryanashcraft/Classified-C" rel="nofollow">https://github.com/ryanashcraft/Classified-C</a>
prtamilover 12 years ago
Every Smart guys is trying to bring Lisp's functionality in C Syntax. But i'm stupid , i directly use Lisp. Even its hard and that's why i'm stupid.
eungyuover 12 years ago
A+ for clever use of typedef void star
takenover 12 years ago
how about adding a macro var(name, type, value) -&#62; var name = $(type, value)?
crudbugover 12 years ago
Neat!
areoruiover 12 years ago
Wtf
评论 #4725482 未加载
nspover 12 years ago
0
codgercoderover 12 years ago
bad name
nnqover 12 years ago
it always annoys me when people can't properly <i>write</i> about what they've done. For example, the description says, with reference to C: "I've turned it into something of a dynamic and powerful functional language which <i>it might have once been</i>" ...is his wording wrong or what? ...'cause C <i>has never been</i> a "powerful functional language"
评论 #4726820 未加载
评论 #4726815 未加载