Earlier quoted context omitted.
Preemption can happen even outside of system calls of course, but I guess my takeaway has been to just avoid calling into the system where a lot of things can happen that I don't really understand or control. That, plus setting my threads to high-priority and possibly pinning them to the right cores.
>That, plus setting my threads to high-priority and possibly pinning them to the right cores. What language was that - [normally] Java does not respect priorities at all for instance. Running with higher priority may require root as well.
Carp – A statically typed Lisp, without a GC, for real-time applications
101–110 of 139 posts
Re: Carp – A statically typed Lisp, without a GC, for real-time applications
#102Can somebody please explain or give me some links how FP is supposed to work without a GC? For example Rust has different types of function pointers (Fn, FnMut, FnOnce), to guarantee the possibility of lifetime analysis (so it is arguable to consider it a functional programming language). On the other hand the most common FP languages (OCaml, Haskell) all come with a GC. Or am I wrong in assuming this is a functional…
Re: Carp – A statically typed Lisp, without a GC, for real-time applications
#103Re: Carp – A statically typed Lisp, without a GC, for real-time applications
#104Earlier quoted context omitted.
AOT doesn't necessarily mean GC-less, right?
Maybe they actually mean VM-less, which would probably imply GC-less because if you have a GC, you pretty much have a VM doing the GC (unless it's simple ref-count). For embedded, you need VM-less, I think, as VMs tend to be too heavy.
It's just normal library code usually called by the allocator, and well-specified memory object/pointer layouts.
Re: Carp – A statically typed Lisp, without a GC, for real-time applications
#105Earlier quoted context omitted.
C++/CLI comes to mind, as means to merge .NET and C++ worlds together.
Oh gosh, I forgot about that. Is that Windows only though? I remember MSVC had managed/unmanaged C++ and allowed calling between the two.
And although they don't have much love for it, they still keep it relatively up to date.
It was one of the .NET Core 3.1 main milestones.
However I would say for the purpose of binding .NET and C++, probably it doesn't need to understand everything anyway.
Re: Carp – A statically typed Lisp, without a GC, for real-time applications
#106Earlier quoted context omitted.
It's really surprising that it's rare in functional languages. Immutability seems like it should guarantee no cycles (?), so reference counting could be used.
Why would immutability guarantee no cycles? Here is a line of valid haskell: star e = let (sp, a) = (Split a e, atom sp) in sp EDIT: I guess I should probably explain it: star is a function that takes an expression "e" and returns the value "sp" which is "Split a e" where "a" is the results of calling the "atom" function on "sp". This is creating a representation of a regex star operator. Note that the tuple defined…
But yes, such code is often useful so that e.g. a parent xml node can refer to its childen nodes while also children nodes can refer to their parents.
Anyway, I'm not sure about this, but I think you can't have circular data structures in the context of strict evaluation (or can you? maybe by defering execution via anonymous functions? I wonder....)
Re: Carp – A statically typed Lisp, without a GC, for real-time applications
#107Earlier quoted context omitted.
As long as you forbid or mark cycles (…or ignore the problem) lifetime analysis can be done statically. Which is better anyway. Automatic memory management doesn't need a GC.
It's really surprising that it's rare in functional languages. Immutability seems like it should guarantee no cycles (?), so reference counting could be used.
Re: Carp – A statically typed Lisp, without a GC, for real-time applications
#108Earlier quoted context omitted.
So how is memory fragmentation avoided?
That's a question for the underlying allocator, surely? (Quite often the answer is "it isn't")
Re: Carp – A statically typed Lisp, without a GC, for real-time applications
#109There is also interesting CL implementation that is based on the LLVM framework - Clasp[1]. It can be natively compiled and designed for performance. [1] https://github.com/clasp-developers/clasp
CLASP is a really interesting project. For one, it's created and written by a Chemistry PhD researcher (Christian Schafmeister), not someone with a traditional CS background. For another, it's one of the few languages that has ever attempted to interface with C++ at the template level - you can instantiate C++ template classes from CL, and catch C++ exceptions etc. For yet another, he does compacting garbage collecti…