From owner-freebsd-questions@freebsd.org Tue Jul 14 01:38:43 2020 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 31A05350768 for ; Tue, 14 Jul 2020 01:38:43 +0000 (UTC) (envelope-from dwilde1@gmail.com) Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B5NTG3gPDz3Zrk for ; Tue, 14 Jul 2020 01:38:42 +0000 (UTC) (envelope-from dwilde1@gmail.com) Received: by mail-pl1-x632.google.com with SMTP id x9so6336275plr.2 for ; Mon, 13 Jul 2020 18:38:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=p1x1VF8hcaBbmYJpuRQhJ4c+0hiODmwvxk1xoQk7rFQ=; b=nvEaY1K/haZ1f3phISn5kYlknbVIdh+3oeqj2MunUgwDeMQ/x26Dq2SUF1FOM22gMP 8rjZfx4PxTLula6QiSjsMStJoY90rba0Qay5828GlbWRDdOjqcG3+0oYYTtbGJpsq7Sa nDG7E30YMEVmbCuVJJD31/eReBHJcxMpBtkqsUH/o9z0/GrVvwrpt+IMhq6546HfFhxz mIGcpQpIPZwuAHauSZahTenxkkJmiFJ4R2AktjRyXdRnYSJZiX5QJXEUT07Rs3o5GYc7 Fc6gsPNYoopEZTmauLrvLpP5wrDoD7t/MoosnF53oXV7EzgxR8hy/uH7CSC4bmMNc4if xJ4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=p1x1VF8hcaBbmYJpuRQhJ4c+0hiODmwvxk1xoQk7rFQ=; b=Yo6cadMcz+6HqtB77Zij6rAf+500sQVhKyBqh/Ll3EGDrA2cY30cOxyDjHYCAV4o0L QN+Ng4hFKfhrex4kIz/JxHf1w7P/dmme+0YIGmaQ1k1psBH5rzYJY0oLRWEavXfCvr7M dYsnTe0rcjryp6t9BCzwbfWcNgv1ee3ztBYBD9Q5Z4/asOvQ0FSKPBuHF8lX98i3mL7B 4VdyLkLxyYSBym1jowT9RF+L4hW2+RvvTrTquOxTpljg/jLV1bMPaow3OXCjzJ+DMVPS O3O5mFURr6vvgNFlBGY4BJ5f9ro9BQy9mCSR+4tbb5hVEpBsGeTg5gpB7rNsogpd8MCl 1GDg== X-Gm-Message-State: AOAM532GrAGyOLHLYD9uZ6jO+nt7eiqcONI4xvcW/JB8vRtFN+0NiHwk U3tM5+YfSi79YLv+9O1LA1Mbso0e X-Google-Smtp-Source: ABdhPJxG6S4ZOk/a013Ahckzg/nmjP8Sf1ijI/6Ef/TDt8415tEMsdMHH9ZCXOIzPtdfgCxQ+JrY0g== X-Received: by 2002:a17:902:c206:: with SMTP id 6mr2087583pll.30.1594690720102; Mon, 13 Jul 2020 18:38:40 -0700 (PDT) Received: from [192.168.0.4] (174-26-193-115.phnx.qwest.net. [174.26.193.115]) by smtp.gmail.com with ESMTPSA id ji2sm697588pjb.1.2020.07.13.18.38.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 13 Jul 2020 18:38:39 -0700 (PDT) Subject: Javas, C++ and Ruby To: Aryeh Friedman Cc: Brandon helsley , FreeBSD Mailing List References: <5a761348-fb9f-5cf3-e035-7ba42afcb221@gmail.com> <8fcd60d7-1de1-82dc-d840-2555663ac153@gmail.com> From: Don Wilde Message-ID: <243f3d0b-d664-a122-6d74-294df7f346e5@gmail.com> Date: Mon, 13 Jul 2020 18:38:37 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Rspamd-Queue-Id: 4B5NTG3gPDz3Zrk X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=nvEaY1K/; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of dwilde1@gmail.com designates 2607:f8b0:4864:20::632 as permitted sender) smtp.mailfrom=dwilde1@gmail.com X-Spamd-Result: default: False [-2.57 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.95)[-0.951]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; RECEIVED_SPAMHAUS_PBL(0.00)[174.26.193.115:received]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_SPAM_SHORT(0.34)[0.343]; NEURAL_HAM_LONG(-0.96)[-0.960]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::632:from]; FREEMAIL_CC(0.00)[hotmail.com,freebsd.org]; RCVD_TLS_ALL(0.00)[] Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jul 2020 01:38:43 -0000 On 7/13/20 5:46 PM, Aryeh Friedman wrote: > > > On Mon, Jul 13, 2020 at 8:05 PM Don Wilde > wrote: > > > On 7/13/20 3:39 PM, Aryeh Friedman wrote: >> >> >> On Mon, Jul 13, 2020 at 6:16 PM Don Wilde > > wrote: >> >> >> On 7/13/20 2:49 PM, Aryeh Friedman wrote: >>> >>> >>> On Mon, Jul 13, 2020 at 12:46 PM Don Wilde >>> > wrote: >>> >>> >>> On 7/13/20 5:59 AM, Brandon helsley wrote: >>> >> Personally, I like the LLVM-based CLANG and >> Crystal. Most of the installation time comes from the various >> versions of LLVM being requested by the HLL. IMHO, the LLVM >> is a much more flexible and accessible virtual execution >> engine than Oracle's Java and JVM. >> >> >> C/C++ most certainly are not beginner friendly languages and the >> OP is someone who has never done programming before. >> >> >> -- >> Aryeh M. Friedman, Lead Developer, http://www.PetiteCloud.org > > Doesn't make him a bad guy, Aryeh. Given that Brandon is already > doing his best to learn _and_ to contribute to the Project he > doesn't deserve such crabby comments, although I expected such > when I bracketed my opinion with . > > > What I misreading I never said he (or you) were "bad guys". Understood. Your comments were very succinct and *I* took that as rude. My apologies. > > IMHO, while Java syntax is deceptively simple, your comments to > date prove that _using_ the language in the real world is not > trivial. I made the mistake a few months back of attempting to > compile the entire JDK8 code base on a rock-stable Ubuntu 18 > system and it was a nightmare. The successive approximations you > have gone through to get a working IDE and JVM deployment > environment for Java show that it is a challenge, even for an > experienced coder as you obviously are. > > > Again *WRONG* I got Java to work as advertised right out the box with > nothing more than portmaster -d java/openjdk8 (that is all I have ever > needed to do on FreeBSD since the first time I ever used it on FreeBSD > back in 2004).   My "difficulty" with IDE's is not a "difficulty" only > a general very strong dislike of IDE's in *ANY* language (and I have > had the same issues with them in all languages for example Eclipse > when dealing with C/C++ drags around huge libraries that are not a > part of the STL or StdLib [or even Boost] and are a hell and half to > compile outside of Eclipse). Now, THAT makes a lot of sense, Aryeh. I have yet to even *attempt* to compile Eclipse from source on freeBSD. I, too, am heading towards simply adding source highlighting to EMACS and using it for everything. Unfortunately, in a lot of specialized work we do like data science, one needs a lot of specialized libraries. Perl with CPAN started this trend, but Python's taken that over the top, especially with the proliferation of scientific and DS tools. > > And Java is one the most natural languages I have used there are no > bizzare exceptions such as there are in JavaShit (oops JavaScript), > C/C++, etc.   If a keyword/construct works in place/platform A a given > way then it is guaranteed to work on place/platform B (even if on > radically different devices and/or OS's for example if I stay away > from Android only libraries then anything I write in FreeBSD will work > there without modification or recompiling and it will also work on > Window$, MacOSX, etc.). > > As to code complexity Java has *MUCH* simpler code then C/C++ or > almost any other non-scripting language (almost all of which are not > as general purpose as they claim) I want to just give a example that > should prove my point.   In 1993-1995 I helped write one the first > streaming media (video) servers in C/C++ took a team of 5 and 100+ > KLoC.  I wrote a similar video capturing program in Java in June > because my SO was not able to find any suitable screen > capture-->streamable video software that would work on all the > platforms we needed to work on (she teaches computer science at the > local university which has decided to call 100% virtual next > semester).   The Java version was less than 200 lines of code (ok I > cheated a little and left the stitching together of screen snapshots > to graphics/ffmpeg) that has a better frame rate (30 FPS vs. 10 FPS) > and audio then we ever achieved in the C/C++ version above (credit > Moore's Law mostly here).   Note the Java version used nothing but the > standard Java library that comes with OpenJDK8.   Another case is I > just wrote some code for the EMR to interface directly with a remote > MySQL instance (first time we have used an external DB) and was able > to have it automatically generate the needed SQL statements and such > based on the structure of the data at run time in less than 100 lines > of code, last time I did that C/C++ it was over 1000 lines of code and > it was not able to handle dynamic structures at runtime while the Java > version can (again the Java version used nothing but the standard Java > library and a J/OBC driver [devel/mysql-connector-java]). I'll certainly agree with your statement whole-heartedly: "As to code complexity Java has *MUCH* simpler code then C/C++ or almost any other non-scripting language," although I would argue that Java IS a scripting language since the JVM _is_ the interpreter. Disagreement on terminology, because with LLVM, so are CLANG and Crystal. > > > AFA CLANG and Crystal, C++ is what colleges teach newbie coders in > CS. Business apps coders headed for IT and (shudder) the IT web > stack get Java. Admittedly, they don't go very deep (in either of > those cases) but the user base is out there.  C++ is also what a > lot of FreeBSD itself is written in these days, so knowing at > least something about it is A Very Good Thing(tm). > > > Actually Java has been the language of instruction at most schools > (grad/undergrad CS [not IT]) for almost 20 years now: > https://www.bestcomputerscienceschools.net/what-languages-will-i-learn-in-a-computer-science-program/ > ... Says most schools use Java with a smaller number using C/C++ and > then even smaller numbers using misc. languages. Almost every CS (not > computer engineering) paper I have read in the last 15 years uses Java > as the reference language when dealing with general CS topics > (specific topics like OS's of course are in other languages like C/C++). Okay, my attention hasn't been on colleges, so I'll accept that. I do agree that Java is a much better first language choice than C or C++. > > I agree C/C++ is definitely worth learning just not as a *FIRST* > language (much more worth it then JavaShit). Ohh, gawd, yes. I'm fighting that sh!t-storm now as I've been asked to do a web-resident demo of my library. the right choice of jQuery wrappers helps, but it's still a royal PITA. > > > Crystal is based on Ruby, the most elegant language I have ever > used, and I started with assembler on 8-bit micro controllers in > the 80s. That's MPHO, but I've been coding for the Ruby > interpreter since 2004. Crystal has a wonderful combination of > both dynamic and static typing. It's a language with incredible > depth but elegant simplicity, and it's extremely well documented > from top to bottom. > > > Quick note dynamic typing in *EVERY* language I have seen it is just > asking for it! That's why I like Crystal. It lets you play fast and loose, but it insists that eventually ALL variables *must* have a known and *completely* defined union of possible types. It takes a while to compile, but that's because it's checking every possible case of every decision tree, not just the high-level syntax. It refuses to let you leave any dangling variables, period. I completely agree that dynamic typing is fraught with peril for *any* production environment. > > I have used Ruby and really liked some aspects of it like mix-ins but > soon discovered that Java had them also in the much more elegant form > interface(s) (keyword) and "smart" enums [as far I know no other > language allows you to use enums this way] that allow you to have > reflective like behavior without the bottomless pit of reflection. Sounds like we agree on more than we disagree, Aryeh. Sorry I got defensive! I'll look up these "smart" enums, and see if I can replicate them in Crystal. :D -- Don Wilde **************************************************** * What is the Internet of Things but a system * * of systems including humans? * ****************************************************