Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Why C/C++ for system programming?

Name: Anonymous 2012-03-08 5:18

It is unsafe, verbose and not particularly fast. Why I'm writing much more readable code with Lisp, using the same API?

Lisp:

(defun folder-p (path) (w/opendir (dir path) (not (null-pointer-p dir))))
(defun file-p (path)
  (unless (folder-p path)
    (w/fopen (f path "r")
      (not (null-pointer-p f)))))


C/C++:

int folderP(char *Name) {
  DIR *Dir;
  struct dirent *Ent;
  if(!(Dir = opendir(Name))) return 0;
  closedir(Dir);
  return 1;
}

int fileP(char *Name) {
  FILE *F;
  if (folderP(Name)) return 0;
  F = fopen(Name, "r");
  unless (F) return 0;
  fclose (F);
  return 1;
}

Name: Anonymous 2012-03-08 5:27

You can have very fine grained low level control in C and C++. Which Lisp dialect permits this and also integrates with existing libraries of code (so you can spend time on the important stuff and not reinventing the wheel)?

Name: Anonymous 2012-03-08 5:30

>>2
You can use cffi and almost every aspect of C programming in Lisp, if you really want to.

Name: Anonymous 2012-03-08 5:33

>>2
Most mature Lisps allow inline assembly.

Name: Anonymous 2012-03-08 5:38

not particularly fast.
Full retard.

Name: Anonymous 2012-03-08 6:29

>>5
Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp.

Name: Anonymous 2012-03-08 7:01

>>6
A wild wikipedia knight appears!

Name: Anonymous 2012-03-08 7:27

Name: Anonymous 2012-03-08 7:55

Any sufficiently complicated CL or Scheme program contains an ad hoc, informally-specified, bug-ridden, slow implementation of a mental midget neocortex.

Name: Anonymous 2012-03-08 7:57

>>11
nice

Name: Anonymous 2012-03-08 8:08

>>10
T.Hanks!

Name: Anonymous 2012-03-08 8:24

>>1
Is that what kids these days think system programming is?

Name: Anonymous 2012-03-08 8:31

>>12
Everything lower is just an implementation of a Lisp OS core.

Name: Anonymous 2012-03-08 8:39

>>12

sorry, yes, dealing with file and folder horseshit is the definition of systems programming. why do i even have to think about this old timey nonsense. can't we just rub ipads together to exchange vital info, u queer

Name: Anonymous 2012-03-08 9:06

>>14
You can always have tagged FS.

Name: Anonymous 2012-03-08 12:34

>>14
I thought dealing with hardware was the definition of systems programming. Are we all sucking the cock of the Google Goverlords now? Guess it's time to take down the GJS pinups on my ceiling and pucker up for Pike and Thompson.

Name: Anonymous 2012-03-08 12:40

>>16
Not really. Systems programming is all about nerdy daemons, networking, security and what not.

Name: Anonymous 2012-03-08 14:08

>>6
Any sufficiently complicated Common Lisp or Scheme program contains an ad hoc, informally-specified, bug-ridden, slow implementation of macro-based DSLs.

Name: Anonymous 2012-03-08 14:09

>>17
LOL! XD SO RADNUMM HAHA

--
Sent from my iPhone

Name: Anonymous 2012-03-08 15:24

>>16
Systems programming encompasses all forms of programming involved in building or maintaining a platform (or system) for applications to run on. It is a superset of both interaction with hardware and operation of daemons, among other topics.

Name: Anonymous 2012-03-08 16:15

PROTIP: YHABT.

I'm outta here.

Name: Anonymous 2012-03-08 17:59

just use both.


C++ to memory map pointerless c structs of your data and then access that from the common lisp foreign data access.

the struct field complies down into 2 instructions and so there's no performance penalty to accessing C instead of common lisp objects.

the lisp garbage collector will never see the data, each pointer to a c object is simply a fixnum and you only ever have to wrap it in lisp to improve debuggability

to allow the lisp to compile into efficent assembly, you can use lots of macros but avoid closures, generics and fancy sequence functions.

Name: Anonymous 2012-03-08 19:20

>>21
Where are you off to, exactly?  Perhaps a thread on /prog/ that isn't a troll thread and is instead filled with insightful discussion about programming?

Name: Anonymous 2012-03-08 20:18

>>23
Ooh! I remember that thread!

Name: Anonymous 2012-03-09 0:16

>>22
>the struct field complies down into 2 instructions and so there's no performance penalty to accessing C instead of common lisp objects.
There is no perfomance penalty accessing defstruct fields.

Name: Anonymous 2012-03-09 2:44

Common Lisp is diarrhoea.
Lisp is shit.
Everything is worse.

Name: Anonymous 2012-03-09 2:49

>>26
Good! Let the butthurt flow through you.

Name: Anonymous 2012-03-09 3:44

>>27
It's the shitposter. It's safe to ignore him.

Name: Anonymous 2012-03-09 6:10

>>9
I'm a midged and I find that offensive.
Anyway grow some beard on your ass and use c/c++.
Lisp is for pussys.

Name: Anonymous 2012-03-09 12:50

>>27-28
why don't you two faggots get a room?

Name: Anonymous 2012-03-09 14:36

>>29
lisp is far too powerful for you.
you could not understand it if you tried

Name: Anonymous 2012-03-09 16:04

>>31
I understand Lisp, so I also understand why almost every Lisp I've encountered so far isn't a proper Lisp.

Name: Anonymous 2012-03-09 17:27

C and C++ aren't enough. Even D isn't enough. It's time for the new lagrange, D++.

Also known as ``Say it. Out loud.'' ``Dubbles.''

Name: Anonymous 2012-03-09 17:38

please use javascript for this type of work, ``thank you!''

Name: Anonymous 2012-03-09 18:33

Despite being having a third of the number of lines, the lisp code still manages to have more brackets than the c code. We don't do system code in lisp because everything soon turns into a clusterfuck of brackets.

Name: Anonymous 2012-03-09 18:40

>>35
If LisP proqrammers new how to fuqing indent they're code, we would don't have this proqlem¡

Name: Anonymous 2012-03-09 18:41

>>33
WHYWHYWHYWHYWHYWHYWHYWHYWHYWHYWHYWHYWHY

::HEAVE::

WHYWHYWHYWHYWHYWHYWHYWHYWHYWHY

Name: Anonymous 2012-03-09 19:06

>>37
Dunno about UuUu U Uuu!!!!?!!, but U!??!??! Uuuuuu uuUUuu uuuUUUu uUUuuu UuUuuu uuuUuu UuuUuu U?!!!?! tomot

Don't change these.
Name: Email:
Entire Thread Thread List