Better HN
topnewbestaskshowjobs
Log inSign up

hellofunk

9,428 karma · joined Jul 10, 2015 (11y ago) · 3,276 submissions

John Bellick, Mexico City
Submissions

comment 9y ago · link · parent

A spoof is about orders, not trades. Those are two very different things.

comment 9y ago · link · parent

> Is there a law that stated/states all trades need to be with real intention to buy?

We're not talking about trades, but rather the illusion of an intent to trade, when really there is no intent, and pushing that illusion onto the world to give the market the impression you will trade that amount, causing other market participants to react accordingly, which causes the market to move in the direction you wanted. Then you cancel your planned trade and profit off the move you manipulated.

That's the gist of it, and yes there are laws against it.

comment 9y ago · link · parent

My point was more to the readers of HN who wouldn't know, and the title just says "Lisp is not functional" so I was providing some context.

comment 9y ago · link · parent

Well, opinions may vary, but I own this book and the word phenomenal is not appropriate. Most CL hackers I know do not take this book too seriously. It is loaded with pretense and self-congratulatory comments.

comment 9y ago · link · parent

And there's a big group of academics, nearly all of them, that refer to lisp as a family of languages with many dialects.

comment 9y ago · link · parent

Depends on the lisp. CL is not so functional, it is multi-paradigm. Clojure, however, is mostly functional.

The complexities surrounding state in CL are not unlike any other non-functional language. I find it hard to call a language functional if it doesn't strongly encourage immutability (or require it) and, preferably, have persistent data structures.

It's for these two reasons that I don't think Swift is functional, and I don't consider CL to be functional.

comment 9y ago · link · parent

I assume you would have the same reaction to someone proclaiming any other language as their favorite, also?

comment 9y ago · link · parent

My weekends are usually pretty rough and unstable, so I went with this one several months ago and it fits well into my life style: https://en.wikipedia.org/wiki/Brainfuck

comment 9y ago · link · parent

This reminds me a lot of how wolfs eventually became domesticated into today's dogs. It was covered nicely on an episode of Cosmos. The path they took was not unlike what is described here for cats.

comment 9y ago · link · parent

> Which the clojurescript compiler devs have addressed in recently released alpha features

Which the article mentions.

comment 9y ago · link · parent

But that's a two-edged sword. Many Java developers, especially those recently out of school, who have never had a C or C++ background, think the GC is a magical blanket that takes care of everything, and as a consequence they don't have an intuitive grasp of the true costs of memory. They just throw things around like it's no big deal. I've interacted with a lot of C++ developers who were hired to rewrite large Java applications in C++ for performance reasons, when really Java could have handled it if only the developers understood memory better.

GC is an abstraction that can work well but can also interfere with how a developer thinks.

comment 9y ago · link · parent

all the ads!

comment 9y ago · link · parent

Unfortunately, because there is such wide income disparity in the world, you are always going to compete against another competent freelancer who will accept much less than you. That drives everyone's rate down. I'm speaking primarily about remote freelancing jobs, which are the only ones I've accepted over the last many years.

comment 9y ago · link · parent

Only partially, in Swift, it is still up to the user to cleverly work around scenarios that the system does not catch. Which is why you have weak references and other many tricks in the language to circumvent infinite reference cycles and related problems. It's hard to call language garbage collected when you have to deal with all that stuff yourself. Just look at the stuff you have to do sometimes in your closures to avoid them creating memories leaks.

comment 9y ago · link · parent

> Now std::*_ptr<> types don't count to make the language GC, because their use is not enforced by the compiler.

Then you also shouldn't say that Swift is garbage collected.

comment 9y ago · link · parent

The risk of memory problems don't disappear because of any form of GC. The problems are just different, and leaks are still quite possible.

comment 9y ago · link · parent

And technically, also unique_ptr, which has a reference count of 1 or 0.

comment 9y ago · link · parent

emplacement doesn't handle lifetime management; the vector itself does this, whether you emplace or push.

push_back with a stack object will copy the object, yes. Emplace_back with a stack object will also, they are not much different. But if you emplace by creating the object inside the emplace call itself, then there is no copy.

see the examples here:

http://en.cppreference.com/w/cpp/container/vector/emplace_ba...

comment 9y ago · link · parent

That's a strange comment. You don't understand why someone would enjoy or have as a favorite C++? Just because it doesn't work for you, it shouldn't be awesome for someone else?

comment 9y ago · link · parent

Emplacing an object that already exists misses the point of emplacement.

comment 9y ago · link · parent

Yes. You will have a memory leak if you don't delete that memory later.

But don't use new. Just push/emplace it into the vector. Perhaps ask more on stackoverflow.

comment 9y ago · link · parent

But template metaprogramming is not at all what is meant by modern c++. We're talking about using smart pointers and lambdas with the algorithm library and other major conveniences (like simplified multithreading), which are all really great since C++11/14.

comment 9y ago · link · parent

If only the stack were large enough for everything. In which case, use unique_ptr.

comment 9y ago · link · parent

> Say I want to create a std::vector of objects. From what I understand, I have three options.

Vectors already own their contents, so there is no need to use unique_ptr here. The objects will be allocated on the heap either way, and you don't need a stack object either. Just push or emplace the object into your vector and be done with it. When the vector is deleted, so will its contents, automatically.

comment 9y ago · link · parent

>what exactly is the difference between make_unique and plain old unique_ptr

make_unique is just a convenience function for creating a unique_ptr without having to write "new" yourself. It returns a unique_ptr.

comment 9y ago · link · parent

Then C++ is also garbage collected.

comment 9y ago · link · parent

With C++ since C++11, there is little need for garbage collection. I haven't written a manual memory "new" or "delete" in years, thanks to unique_ptr (which in my benchmarks is somehow also faster than manually managing the memory).

comment 9y ago · link · parent

> a rather weak type system, one inherited with relatively few changes from C

I don't understand this statement at all. C is a much weaker type system than C++. You can do things in C that will never compile in C++, it is much, much stricter.

comment 9y ago · link · parent

Re: green threads

The C++ Actor Framework is awesome

https://actor-framework.org

comment 9y ago · link · parent

I'll have to give µWS a try. I've been using websocket++ [0] which I've also found to be excellent and stable, but a bit verbose to use.

[0] https://github.com/zaphoyd/websocketpp

1
626364
110