logs archiveBotHelp.net / Freenode / #ada / 2015 / August / 3 / 2
marble_visions
the base system is the thing you get out of the box without installing anything
but in a real world scenario that isn't the case 99% of the time
the hardened gentoo approach -- linux + pax patches + compiler that produces PIEs
is better than the openbsd approach -- rocksolid base, but if you install anything else, you lose
also you've got things like grsec settings and optional MAC with a learning mode
Natacha
Oh sorry, I didn't reallized the discussion was already beyond the point of uselessness
marble_visions
the whole philosophy of "apps are sh*t and vulnerable, let's work on that" is superior IMO vs "we need to write apps right the first time and they are perfect"
for security of course*, if you are a developer the reverse mindset is probably better.
i've been searching for my distro for a long time, license-wise the bsds are awesome
but that's just about it,
<end of rant>
PS: hardened gentoo is the way to go
and if you are tin foil-grade paranoid, you can even deblob the kernel and allow only software with GPL-*/BSD-*/MIT-* licenses
of course, provided you trust your CPUs microcode not to be backdoored
but only stallman talks about that
antranigv
is there anything like free/libre CPU?
marble_visions
antranigv: check opencores.org
short anwer -- no.
antranigv
I have this weird feeling that in small communities you learn more (like in #ada or #oberon)
marble_visions
i've learned a ton from #gentoo and #gentoo-chat
but they aren't small
charlie5
with big irc channells q's tend to get swamped into oblivion
marble_visions
long answer, you've got CPU designs (the code, written in HDL), but no one has the money/interest to mass produce them. i think opensparc is the biggest FOSS CPU project
if you've got an FPGA, you may be able to run them for testing
antranigv: are you having issues with something? why do you think you don't know enough programming to start with an ada tutorial?
antranigv
marble_visions: not yet, hmm, well, once I tried to read an Oberon book, but my knowledge was not enough, so I always think that it will never be, kinda, however, for the last 2-3 months I was reading python :) it's still ok till now.
I have to say, 3 hours with Ada, and I like it more that Python.
marble_visions
antranigv: I've got an interesting programming problem that takes a walk through a lot of programming tasks -- reading from CLI, creating a rudimentary parser for a set of commands, a bit of algorithms
i can send you the thing if you want
if you try implementing it in ada, you'd learn a lot
i did
antranigv
marble_visions: like an exercise? nice, sure! (:
marble_visions
antranigv: https://www.dropbox.com/s/d0c5urtoky105sv/Shopping%20Center.doc?dl=0
they guys have done a good job, if you redistribute, I guess it's fair to keep the headers/footers
have fun!
s/they/the
antranigv
ahh this looks interesting!
marble_visions
this was originally from a c# course, but it doesn't matter, you can use it for ada
"Allowed working time for your program: 2.50 seconds. Allowed memory: 256 MB." that's the fun part
i haven't completed it myself, but I've got a lot of WIP
antranigv
WIP?
marble_visions
work in progress
i think the key point in the beginning is to avoid microoptimization -- just use unbounded strings and whatnot, the speed and size of the program will be affected the most by the data structure you are using for storage
antranigv
wow, it automatically understands unicode as well.
marble_visions
ada? yep.
not that impressive, java, cpp and c# do that as well.
antranigv
CPP? it did not with Armenian (UTF-8), python does, only version 3+, C does not :/
marble_visions
yeah, but can't expect C to support that :D
antranigv
Geeze, hello world with Oberon-2 is ~12kb, with Ada is ~500kb,
marble_visions
your code runs inside an ada runtimr
s/runtimr/runtime/
antranigv
it does? wait, it's not native?
marble_visions
it is native, but i kind-of gets wrapped around by that runtime
s/i/it/ what is happening today
it is still compiled
antranigv
aha~, so the runtime is inside the executable as well?
marble_visions
yes.
there are compiler switches or pragmas IIRC that disable the runtime, but someone needs to elaborate more on that
antranigv
that's why gnat is so big, while an oberon compiler is just 10-12 MB.
marble_visions
maybe
also, i think if you enable the SPARK switch/pragma/whatever, the runtime is stripped again as well
along with a big subset of the language features
i think all of this info is in the ada manual
pcc
The Ada runtime system is no different in principle from that of any other language such as C or C++. It might be larger because of Ada's rich feature set, however.
Although the Ada runtime probably isn't much larger than C++'s.
It will, of course, depend on the compiler, etc.
marble_visions
pcc: how does C have a runtime? i tought i only slapped on the references libs or a pointer to them and that's it
s/tought/thought/ i should stop writing.
pcc
When I speak of a "runtime" here I'm talking about the code added by the compiler to support the features of the language.
So for example, if you are compiling for a target with no floating point unit but still do floating point computations, the compiler must add calls to some internal library functions to do the floating point.
Those library functions constitute the "runtime" in the sense that I mean.
C is unusual amoung programming languages in that it requires very little of this in general.
But C++ (and Ada) need support for exception propagation, run time type identification, dynamic initialization, and so forth.
So the additional code required to make all that happen isn't necessary trivial.
marble_visions
oh, i hadn't though about that, you are absolutely right.
pcc
In a language like Java most of the "extra" stuff is provided as a service by the Java Virtual Machine. In a native language the compiler (and linker) dump the necessary support code into the executable... or maybe link to it via a shared library or whatnot.
Embedded systems people programming constrained devices worry about this a lot. One of the reasons C is dominant in that work is because the amount of runtime support the language absolutely needs is extremely minimal.
marble_visions
But Ada's runtime can be chopped to a minimum as well, right? Can it be comparable to C in that aspect? If, say, you remove exceptions, dynamic memory management, etc?
antranigv
what is the difference of using use statement in/out of declaration part? (;
(:
pcc
That's going to be compiler dependent but, yes, it is reasonable to hope that if you include appropriate restrictions that you can also use a limited runtime system.
Most likely you'll need to explicitly ask for a limited runtime when you build your program. Just using pragma Restrictions (for example) may not actually cause a different runtime system to be used.
antranigv
ah, let me guess, if in the declaration part, the direct functions will be available only for the current subprogram.
pcc
antranigv, yes the effect of the 'use' is scoped as you expect.
It allows you to bring names into direct visibility in an inner scope without force all those names on the entire compilation unit.
forcing all...
Natacha
I think the libc should be considered as C runtime too, since it's defined by C standard just like Ada's Annex A
The thing that makes executable size comparison unfair is that by default GNAT statically links, while other languages I know dynamically link the runtime
by default
pcc
Natacha, that seems like a reasonable point of view, but then again you aren't required to use the functions in the C or Ada standard libraries whereas you need a true runtime in order for the language to "work."
But I agree that the distinction is a gray area for sure
Natacha
well, both have options to remove the runtime entirely
but then you get to the grey area between runtime code and generated code
pcc
Dynamic memory allocation is a good case study. In Ada it is "built in" but in C you have to call a library function. On the other hand both language runtimes probably do some initialization, etc, to support it.
Natacha
and similarly, tagged types can depend on some runtime library or be handled entirely through code generation
antranigv
I still don't understand the meaning of "for n in 1 .. 10 loop", why "for smthn" ? as I got, I'll need that for later, hu?
joakim
antranigv: it's short for "for n in Integer range 1 .. 10 loop"
Lucretia
yeah, using gentoo, but nerdboy is a gentoo dev :D
as for open cpu's there is RISC-V which has potential, but needs more work and an open GPU
for anyone to take it seriously.
« prev 1 2 3 4 5 next »